当前位置:网站首页>Login of MySQL [database system]

Login of MySQL [database system]

2022-07-25 14:45:00 Hua Weiyun

 1. Stop and start of service

MySQL After installation , The server process needs to be started , Otherwise, the client cannot connect to the database .

edit

 --- Run as administrator windows Command prompt , Otherwise Access denied

edit

#  start-up MySQL The service command net start MySQL service name #  stop it MySQL The service command net stop MySQL service name 

1.MySQL The service is in a stopped state :

2. start-up MySQL service :

 3.MySQL The service is in a started state :



 start and stop The following service name should be consistent with the service name specified when configuring environment variables .

2. Login and exit

Format :

mysql -h  Host name  -P  Port number  -u  user name  -p password 

give an example :

mysql -h localhost -P 3306 -u root -pabc123  #  Previously set root The user's password is abc123


Landing successful :

  There is a warning here , Just change the method of password input :


Exit command :



  Be careful :

(1)-p There must be no space between and password , There may or may not be spaces between other parameter names and parameter values . Such as :

mysql -hlocalhost -P3306 -uroot -pabc123

(2) It is recommended to enter the password on the next line , Keep it safe .

(3) The client and server are on the same machine , So the input localhost perhaps IP Address 127.0.0.1. meanwhile , Because it is connected to this machine : -hlocalhost You can omit , If the port number has not been modified :-P3306 You can omit it .



Before landing Can pass :

mysql -V

perhaps

mysql --version

  Way to obtain MySQL Server Service version information .


After landing adopt

select version();

View current version information . 

原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/206/202207251437473297.html