3

Some useful MySQL/MariaDB commands to create and provide access to a database.

 2 years ago
source link: https://dev.to/atosh502/some-useful-mysqlmariadb-commands-to-create-and-provide-access-to-a-database-2bo3
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Some useful MySQL/MariaDB commands to create and provide access to a database.

Login to MariaDB with:

mysql.exe -u root -p <your-root-password>

Enter fullscreen mode

Exit fullscreen mode

If your root account doesn't have a password omit the -p option.

Create database with:

create database database_name;

Enter fullscreen mode

Exit fullscreen mode

Grant all access to the user with:

grant all on database_name.* to 'root'@'localhost';

Enter fullscreen mode

Exit fullscreen mode

If you are logged in with a different user change root to your username accordingly.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK