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
A style sheet describes how a document should be ...
Basic network configuration Although Docker can &...
Achieve results Implementation Code html <h1 c...
Table of contents 1. Build the operating environm...
There are few and inadequate installation tutoria...
HTML is made up of tags and attributes, which are...
Have you ever had the need to compute a very larg...
question Nginx takes $remote_addr as the real IP ...
This method was edited on February 7, 2021. The v...
When using MySQL, dates are generally stored in f...
Table of contents Importing JavaScript 1. Interna...
Location means "positioning", which is ...
Virtual machines are very convenient testing soft...
Table of contents 1. Unzip 2. Create a data folde...
1. Background Recently, some friends encountered ...