The command format for mysql login is: mysql -h [hostip] -u [username] -p [password] [database] 1. Normal login mysql database command format: mysql -u username-p password, for example: 2. Set the port number to log in. The default port number of MySQL is 3306. 3. Specify the IP address and port number to log in to the MySQL database. The command format is: mysql -h ip -u user -p -P port number. For example: 4. Create a database login View the currently logged in user and database select user(); select database(); Exit the login command and log in to MySQL. After entering, you may see the following prompt message. You can use help to see the output results. mysql> help For information about MySQL products and services, visit: http://www.mysql.com/ For developer information, including the MySQL Reference Manual, visit: http://dev.mysql.com/ To buy MySQL Enterprise support, training, or other products, visit: https://shop.mysql.com/ List of all MySQL commands: Note that all text commands must be first on line and end with ';' ? (\?) Synonym for `help'. clear (\c) Clear the current input statement. connect (\r) Reconnect to the server. Optional arguments are db and host. delimiter (\d) Set statement delimiter. edit (\e) Edit command with $EDITOR. ego (\G) Send command to mysql server, display result vertically. exit (\q) Exit mysql. Same as quit. go (\g) Send command to mysql server. help (\h) Display this help. nopager (\n) Disable pager, print to stdout. notee (\t) Don't write into outfile. pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. print (\p) Print current command. prompt (\R) Change your mysql prompt. quit (\q) Quit mysql. rehash (\#) Rebuild completion hash. source (\.) Execute an SQL script file. Takes a file name as an argument. status (\s) Get status information from the server. system (\!) Execute a system shell command. tee (\T) Set outfile [to_outfile]. Append everything into given outfile. use (\u) Use another database. Takes database name as argument. charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. warnings (\W) Show warnings after every statement. nowarning (\w) Don't show warnings after every statement. resetconnection(\x) Clean session context. For server side help, type 'help contents' Through the output information, we know the following three commands to exit mysql This is the end of this article about the MySQL login and exit command format. For more relevant MySQL login and exit content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Nginx local directory mapping implementation code example
>>: Detailed explanation of component development of Vue drop-down menu
When releasing a project, you will often encounte...
A colleague once told me to use a temporary table...
<br />For each of our topics, the team will ...
Table of contents background Solution 1 Ideas: Co...
Preface [root@localhost ~]# cat /etc/fstab # # /e...
The mysql 5.7.18 zip version of MySQL is not like...
The one I wrote before is too complicated, let’s ...
Table of contents 1. Middleman Model 2. Examples ...
Within rows, light border colors can be defined i...
If your web application runs on only one machine,...
I believe that everyone needs to copy and paste d...
Provide login and obtain user information data in...
This article describes MySQL index coverage with ...
For example, if I have a Jenkins server in my int...
Install pymysql pip install pymysql 2|0Using pymy...