Ubuntu14.04 install MySQL

Source: Internet
Author: User
Tags mysql login

I started to install MySQL today. I used to download the installation package from the official website, but it was not available after installation. I guess it was necessary to configure it. I found a lot of information on the Internet and the result still failed. Therefore, you have to install it in the software source, which saves a lot of unnecessary trouble.

zhiniaobu@telunsu-K55VD:~$ sudo apt-get install mysql-server[sudo] password for zhiniaobu:

After executing this command, the system will automatically install other software. During the installation process, the system will prompt you to enter the mysql login password.

If the system version is different, the prompt method may be different, but it is similar in general. After installation, execute the command

zhiniaobu@telunsu-K55VD:~$ mysqlERROR 1045 (28000): Access denied for user 'zhiniaobu'@'localhost' (using password: NO)zhiniaobu@telunsu-K55VD:~$ 
The result was wrong. After Google for half a day, the result became less and less patient. At this time, I flipped through my own books and entered the following command.
zhiniaobu@telunsu-K55VD:~$ mysql -uroot -pmysql
Where First mysqlYes command, -UrootIs to specify the user as root, -PmysqlEnter the login password, and the second mysql is the password. If you set another password, replace it with the password you set during installation. Remember Password and-pBetween Do not have spacesOtherwise, it will fail. The following shows how to view all existing databases after I log on successfully.
zhiniaobu@telunsu-K55VD:~$ mysql -uroot -pmysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 61Server version: 5.5.37-0ubuntu0.14.04.1 (Ubuntu)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || mysql              || performance_schema |+--------------------+3 rows in set (0.00 sec)mysql> 

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.