Ubuntu Online install MySQL and some operations

Source: Internet
Author: User
Tags mysql login

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.