Home > Database > Mysql Tutorial > body text

How to log in to MySQL on Linux system

PHPz
Release: 2023-05-28 12:48:37
forward
16988 people have browsed it

The main steps to log in to Mysql on Linux are:

\1. Log in to local mysql:

 mysql -u 用户名 -p # 例如 mysql -u root -p  #先输入,回车 
 # 也可不用空格 mysql -u用户名 -p
Copy after login

Then prompt to enter the password and press Enter;

\2. Log in Remote mysql: There is a host name and port number, sometimes there is no port number

 mysql -h 主机 -P 端口 -u 用户名 -p 
 #也可不用空格 mysql -h主机 -P端口 -u用户名 -p
Copy after login

Then you are prompted to enter the password and press Enter.

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

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template