How to connect to MySQL / MariaDB database
hostname$ export PATH=/usr/local/mysql/bin:$PATH
hostname$ which mysql
/usr/local/mysql/bin
SYNTAX - mysql -u user -p
C:\Program Files\MariaDB 10.4\bin>mysql -u root -p
Enter password: ****
Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 19.Server version: 10.4.18-MariaDB
Find current connection info:
mysql> \s
Below is the alternative command:
mysql> status;
Get current user and current database:
mysql> select current_user,database();
switch to another database:
mysql> use qtest1;
Database changed
mysql> select database();
No comments:
Post a Comment