In Linux, MySQL installation has always been quite troublesome, because the previous installation was caused by complicated configurations. Today, you need to use Qt to connect to MySQL in Linux. Then install and configure one.
1) First, check whether MySQL is installed in the system.
Enter sudo netstat-tap | grep mysql in the terminal
If no result is displayed, no installation result is displayed. If the following information is displayed
2) if not, install MySQL.
Enter sudo apt-get install mysql-server mysql-client on the terminal
The running result is as follows:
During the installation process, you will be asked to enter the password of the root user (the user managing the MySQL database, not the user of the Linux system) and enter the password as required. As follows:
3) test whether the installation is successful:
Enter sudo netstat-tap | grep mysql on the terminal
If the following result is displayed, the installation is successful:
4) You can also log on to MySQL to test
Enter mysql-uroot-p on the terminal and then prompt you to enter the correct password. As follows:
5) some simple MySQL management:
Start MySQL service: sudo start mysql
Stop MySQL service: sudo stop mysql
Modify the MySQL administrator password: sudo mysqladmin-u root password newpassword
Set Remote Access (normally, mysql only listens to port 3306 on IP 127.0.0.1, and denies access from other IP addresses (which can be viewed through netstat ). Cancel local monitoring
Modify the my. cnf file as follows :):
Sudo vi/etc/mysql/my. cnf
Bind-address = 127.0.0.1 // locate this content and comment
6) directory structure analysis after MySQL installation (this structure is only applicable to online installation using apt-get install ):
Database storage directory:/var/lib/mysql/
Related configuration file storage directory:/usr/share/mysql
Related command storage directory:/usr/bin (mysqladmin mysqldump and other commands)
Startup step storage directory:/etc/rc. d/init. d/
7) MySQL graphical Management Software
Generally, two of them are better, one is open source, and the other is charged for commercial usage:
Open-source: MySQL Workbench (detailed usage will be summarized as I use it)
Business: Navicat (paid, with 30 days of experience, I believe you will find a solution later)
So far, the installation and configuration of MyQL in Linux (Ubuntu) are complete.
Thank you for reading!
---- 2014.01.17 By lzq NY