To learn MySQLunder Linux, the first hurdle is how to install and configure MySQL under Linux. We have the patience to do this once and for all.
System version: ubuntu14.04
MySQL version: mysql-server-5.5
mysql-client-5.5
First check if MySQL is installed, (ctrl+alt+t) terminal input command:
sudo netstat-tap|grep MySQL
If there is no response, or if the installation is not displayed successfully, it means that it is not installed.
Here to start our installation work.
The first difficulty to solve:
1, installation command:
sudo apt-get install mysql-server mysql-client
"For new users may appear":
Reading Package List ... Complete
Analyzing Dependency tree for Package
Reading status information ... Complete
There are some software packages that cannot be installed. If you are using a unstable release, this may be
Because the system is not up to the state you requested. There may be some of the software you need in this release
Packages have not been created or they have been removed from the new to (incoming) directory.
The following information may help solve the problem:
The following packages have unsatisfied dependencies:
Mysql-client: Dependent: mysql-client-5.5 But it will not be installed
Mysql-server: Dependent: mysql-server-5.5 But it will not be installed
E: Errors cannot be fixed because you want some packages to stay the way they are, which destroys dependencies between packages.
"Solution": sudo apt-get install mysql-client-core-5.5
If it is not installed, MySQL is installed.
sudo apt-get install mysql-server mysql-client
During this installation, you will enter the password for root (admin MySQL user, non-Ubuntu system user), as required, as follows:
2, test the installation is successful:
Enter sudo netstat-tap in the terminal | grep MySQL
The installation succeeds if the following results occur:
3, you can also login to the MySQL test
In the terminal input Mysql-uroot-p next will prompt you to enter the password, enters the correct password, may enter. As shown below:
Some simple management of 4,mysql:
Start MySQL service: sudo start MySQL
Stop MySQL service: sudo stop MySQL
To modify the MySQL Administrator password: sudo mysqladmin-u root password newpassword
Set up remote access (normally, the 3306 ports used by MySQL are simply listening on the IP 127.0.0.1 and denying access to other IP (viewable through netstat). Cancellation of local supervision
Listen to the need to modify the My.cnf file:):
sudo vi/etc/mysql/my.cnf
Bind-address = 127.0.0.1//Find this content and comment
6 MySQL After the installation of the directory structure analysis (this structure only for the use of Apt-get install online installation):
Database storage directory:/var/lib/mysql/
Related configuration file storage directory:/usr/share/mysql
Related Commands Storage directory:/usr/bin (mysqladmin mysqldump, etc. command)
Starting footstep Storage directory:/etc/rc.d/init.d/