Install MySQL in Ubuntu 14.04

Source: Internet
Author: User
Tags mysql login

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

Www.bkjia.com @ bkjia :~ $ Sudo apt-get install mysql-server
[Sudo] password for bkjia:

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.

Use the Tab key to select OK

You need to enter the password twice. I will enter v here for testing. Easy to use. Remember, it will be used later.
 
If the system version is different, the prompt method may be different, but it is similar in general. After installation, execute the command

Www.bkjia.com @ bkjia :~ $ Mysql
ERROR 1045 (28000): Access denied for user 'bkjia '@ 'localhost' (using password: NO)
Www.bkjia.com @ bkjia :~ $

The result was wrong. After Google for half a day, the result became increasingly impatient. At this time, I flipped through my own books and entered the following command.

Www.bkjia.com @ bkjia :~ $ Mysql-uroot-pv

The first mysql is the command,-uroot is the designated user as root,-pv is the input login password, v is the password, if you set the password is another, replace it with the password you set during installation. Remember that there is no space between the password and-p, otherwise it will fail. The following shows how to view all existing databases after I log on successfully.

Bkjia @ ubuntu :~ $ Mysql-uroot-pv
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 44
Server version: 5.5.37-0ubuntu0. 14.04.1 (Ubuntu)

Copyright (c) 2000,201 4, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.

Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.

Mysql>

MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Build a MySQL Master/Slave server in Ubuntu 14.04

Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS

Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04

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.