Ubuntu上安装MySQL非常简单只需要几条命令就可以完成。
``````
sudo apt-get update
sudo apt-get install mysql-server
会弹出提示,让输入root的密码,根据提示操作即可
``````
使用如下命令来检查是否安装成功,出现以下则成功安装mysql
````
sudo netstat -tap | grep mysql
tcp 0 0 localhost:mysql *:* LISTEN 10732/mysqld
````
登陆数据库
`````````
mysql -u root -p
``````````
show databases; 就可以查看当前的数据库
``````````````
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
`````````````````````````````