1, download MySQL
sudo apt-get update
sudo apt-get Install Mysql-server
Enter the password for root during the download process
2. Turn off MySQL and open MySQL
sudo service MySQL statussudo service MySQL stopsudo service MySQL start
3, after the installation of the operation:
Database directory:/var/lib/mysql/ configuration file:/usr/share/mysql (Command and configuration file),/etc/MySQL (e.g. my.cnf) related commands:/usr/ Bin (mysqladmin mysqldump and other commands) and/usr/sbin startup script:/etc/init.d/mysql (startup script file mysql directory)
#服务启动后端口查询sudo NETSTAT-ANP | grep MySQL
#连接数据库mysql-H 127.0.0.1-p 3306-uroot-p123456#-h is the port number for the remote ip,-p,-U is the user name,-p is the password
4, uninstall
#首先使用以下命令删除MySQL服务器: sudo apt-get Remove mysql-server then, remove any additional software that is automatically installed with the MySQL server: sudo apt-get Autoremove Uninstalling other components: sudo apt-get Remove <<package-name>>-L | grep MySQL | grep II
Ubuntun Download and install MySQL