Install MySQL and Ubuntu tumysql

Source: Internet
Author: User

Install MySQL and Ubuntu tumysql
1. Verify that MySQL is installed on the original host:Run the sudo netstat-tap | grep mysql command to check whether the MySQL port exists. If sudo is not added, the execution fails because of the permission:

$ netstat -tap | grep mysql


Ii. Install MySQL:After confirming that MySQL is not installed on the host, run the command sudo apt-get install mysql-server mysql-client for online installation:
$ sudo apt-get install mysql-server mysql-client

During the installation process, you will be prompted to enter Yes, and then the root password setting interface will pop up. Here, you can set a root password for login to mysql users, you can run mysqladmin-u root-p password to change the password as needed. Of course, you must enter the original password at that time.
$ mysqladmin -u root -p password


Iii. Start MySQL:By default, the MySQL service is started when Ubuntu is started. You can also run the following command to start and close MySQL:
# Start MySQL$ sudo service mysql start # Disabling MySQL$ sudo service mysql stop# Restart MySQL$ sudo service mysql restart# Other commands:$ sudo /etc/init.d/mysql start$ sudo /etc/init.d/mysql stop$ sudo /etc/init.d/mysql restart
Then, run the following command again to check whether MySQL has been started:
$ netstat -tap | grep mysql

MySQL listening on localhost indicates that MySQL has been started.

4. log on to MySQL:Use the command line mysql-u root-p to log on to MySQL:
$ mysql -u root -p


P.S. I recently tried to install MySQL on Ubuntu for your reference. The configuration issue will be resolved later.

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.