mirror of
https://pagure.io/fedora-docs/quick-docs.git
synced 2024-12-01 07:39:48 +00:00
38 lines
645 B
Text
38 lines
645 B
Text
|
= Using the RDBMS
|
||
|
|
||
|
Connect to the MySQL/MariaDB shell using the `mysql` command.
|
||
|
|
||
|
For both of them, the command is `mysql`. The syntax an the options are generally the same.
|
||
|
|
||
|
----
|
||
|
$ mysql -u root -p
|
||
|
----
|
||
|
|
||
|
Once gained access to the shell you can get the running version of the software:
|
||
|
|
||
|
----
|
||
|
mysql> SELECT version();
|
||
|
----
|
||
|
|
||
|
You can create a database:
|
||
|
|
||
|
----
|
||
|
mysql> create schema test;
|
||
|
----
|
||
|
|
||
|
Create a user:
|
||
|
|
||
|
----
|
||
|
mysql> GRANT ALL PRIVILEGES ON test.* TO 'my_user'@'localhost' IDENTIFIED BY 'PaSsWoRd';
|
||
|
----
|
||
|
|
||
|
List the available databases:
|
||
|
|
||
|
----
|
||
|
mysql> show schemas;
|
||
|
----
|
||
|
|
||
|
== Files location
|
||
|
|
||
|
The database disk storage is located in `/var/lib/mysql`.
|