Ubuntu install MySQL online and some operations
1 , installation Mysql to use. 3 a command:
Open Terminal, enter: Sudoapt-get install Mysql-server
Re-enter: Sudoapt-get install Mysql-client
Re-enter: sudo apt-get install Libmysqlclient-dev
2 , specific installation steps:
Install Mysql-server:
Set MySQL login password:
Confirm Password:
Installation Result:
3 , install mysql-client:
4 , install Libmysqlclient-dev:
Installation Result:
5 , after the installation is complete, you can use the following command to check if the installation was successful:
Sudonetstat-tap | grep MySQL
If you see a socket with MySQL in the Listen state, the installation is successful.
6 , enter MySQL:
Access results:
7 , some SQL operations:
View all databases:
To create a database:
To view the database after creation:
Enter the specified database:
To create a table:
To view fields and some non-empty information:
Insert data:
To view table information:
Insert Chinese characters:
Garbled display:
8 , solve garbled problem:
Execute the following command:
Add the following pink area content:
To restart MySQL:
9 , verify that garbled characters are resolved:
re -build a database:
Enter the database:
To create a table:
Insert contains kanji data:
Query table content:
Normal display of Chinese characters:
Quit MySQL, not off:
To close the database:
Results:
Ten , some operations mysql command:
Start the service:
Sudo/etc/init.d/mysql start
To close the service:
Mysqladmin-u root-p shutdown
Restart Service:
Sudo/etc/init.d/mysql restart
Go to MySQL:
Mysql-u User name-P
Enter after entering the password, enter after entering, enter after the terminal command line becomes mysql>
After entering the MySQL interface, the command must be terminated, or the command will not be backed up after execution.
Exit MySQL:
Quit
Ubuntu Online install MySQL and some operations