1 Pre-installation checks
To check if MySQL is already installed on your Linux system, enter the command to try to open the MySQL service:
When you enter a password, the following prompt indicates that MySQL is already installed in the system:
If this is the case, then there is no MySQL in the system and you need to continue with the installation:
2. Ubuntu Linux Installation Configuration MySQL
The simplest way to install MySQL on Ubuntu is to install it online. Just a few lines of simple commands
During installation, you will be prompted to confirm the input yes, set the root user password (which can then be modified), etc., and wait a few moments for the installation to succeed.
After the installation is complete, use the command to verify that it is installed and started successfully:
At this point, you can modify the MySQL configuration file (my.cnf) with gedit according to your own needs, using the following command:
At this point, MySQL has been installed, configured to complete, can be used normally.
3 Try MySQL
1). Open MySQL
Use the following two commands to open the MySQL service and log in with the root user:
The following prompt will appear for successful execution:
2). View the database
Use show databases;
the commands to see which databases are available (be careful not to omit the semicolon ;
):
3). Connect to the database
Choose to connect one of the databases, the statement format is use <数据库名>
, here can not add a semicolon, here we select the information_schema
database:
4). View Table
Use the commands to show tables;
see which tables are in the database (be careful not to miss out ";") ):
5). Exit
Use the command quit
or exit
quit MySQL.
First section MySQL Installation