Way One:
# mysql-u Root-h 127.0.0.1-p
-u username
-H HOST_IP
-P "New_pass"
-D db_name//Specify a database for direct access
-E "sql_language"//Direct execution of SQL statements directly in the interaction
For example: mysql-uroot-hlocalhost-pmypass-d mysql-e "select User,host,password from User;"
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
Mode two: Batch processing mode
# Mysql-uroot ... < Mysql.sql
For example:
Mysql.sql:
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
#mysql-uroot-hlocalhost-proot < Mysql.sql
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
Way Three:
MySQL > Source/path/to/mysql.sql
This article is from the "Lu2yu" blog, make sure to keep this source http://lu2yu.blog.51cto.com/10009517/1622288
Shell Operation MySQL Method