today began to install MySQL, originally to the official website to download the installation package to install, but after installation but can not use, it is estimated to configure it, search the Internet a lot of information, the result or failure. So it has to be installed in the software source, which saves a lot of unnecessary trouble.
[Email protected]:~$ sudo apt-get install Mysql-server[sudo] password for Zhiniaobu:
After the command is executed, additional software is automatically installed, which prompts for the MySQL login password during installation.
If the system version is different, the prompt may not be the same, but it is generally the same. Once installed, execute the command.
results error, Google a half-day, the results more and more impatient, this time turned over their own books bought, entered the following command
[Email protected]:~$ mysql-uroot-pmysql
where the
first MySQL is the command,
-uroot is the specified user as root,
-pmysql is the input login password, the second MySQL is the password, if you set the password is something else, Replace the password you set when you install it, remember that
there is no space between the
password and-p , or it will fail. The following is my successful login to view all currently existing databases.
[email protected]:~$ 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) #, Oracle and/o R its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names 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>