Home >Database >Mysql Tutorial >How to use the mysql command in Linux

How to use the mysql command in Linux

王林
王林forward
2023-05-26 23:45:211928browse

Linux common commandsmysqlThe command is the client tool of the MySQL database server. It works in the command line terminal to complete the operation of the remote MySQL database server.

How to use the mysql command in Linux

Syntax format:

mysql [parameter] [database]

Common parameters:

##-uConnect to the MySQL server The user name of -e executes the MySQL internal command -p to connect to the MySQL server Password
-h The ip address or host name of the MySQL server
Reference example

Connect to the local MySQL server and open the database:

 [root@linux265 ~]# mysql -h localhost -u root -p lxlinux

Connect to the remote MySQL server:

 [root@linux265 ~]# mysql -h 192.168.60.60 -u root -p  lxlinux

The above is the detailed content of How to use the mysql command in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete