1.Install MySQL
root@kallen:~# apt-get install mysql-server-5.5 mysql-client-5.5
2.ADD Users
(1) Select data Sheet
The statements are as follows: use mysql;
(2) Add a connection user account to the users table in MySQL:
Instead of adding the user record directly using the INSERT statement, an error may occur with insert:
ERROR 1364 (HY000): Field ' ssl_cipher ' doesn ' t has a default value
However, the previous MySQL version did not appear this error, because it has been directly modify the user table or directly using the INSERT statement, and then upgrade MySQL to 5.1, found that this error may occur.
The GRANT statement is recommended for authorization with the following statement:
GRANT USAGE ON *.* TO ‘username‘@‘localhost‘ IDENTIFIED BY ‘password‘ WITH GRANT OPTION;
The sentence:
"username" is replaced with the username that will be authorized, such as CLIENTUSR;
"Password" is replaced with the password set by CLIENTUSR;
(3) Access to data sheet authorization
After the account has been created, the data table authorization is given to the common user above, and the connection user default permissions added in step 3 are "N", the account must be authorized in the DB table to access the dedicated database, and of course the superuser does not say.
Use the following statement:
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON tablename.* TO ‘username‘@‘localhost‘ IDENTIFIED BY ‘password‘;
The permissions in this statement are determined according to actual needs:
"TableName" replaced with the table name of the data tables authorized for access
"Username" is the Step 2 authorized user name
"Password" is the setup password for step 2 authorized users
This gives the user a select, INSERT, UPDATE, DELETE, Careate, and drop permissions on a data table.
(4) Effective authorization, creation completed
A word can:
FLUSH PRIVILEGES;
3.Install phpMyAdmin
Use a PHP-supported Web server (such as Apache, Nginx, Lighttpd), download phpMyAdmin, install it.
sudo apt-get#注意这是安装到/usr/share/phpmyadmin
Under Ubuntu, run: sudo apt-getinstall phpmyadmin
After a while there will be some settings, such as the selection of servers, password settings and so on. When the installation is complete, there is a 404 error accessing http://localhost/phpmyadmin because the phpMyAdmin directory is not mapped to the Apache directory, run the following command:
sudo-s /usr/share/phpmyadmin /var/www/html
[Common ERROR]
(1) Installation error:
ErrorPackage: php54w-tidy-5.4.41-1.w6.x86_64 (webtatic) Requires: libtidy-0.99.so.0()(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
Need to install libtidy-0.99.so:
[Email protected] html]# RPM-IVH libtidy-0.99.0-19.20070615.1.el6.x86_64.rpm
(2) Access error:
In the http.conf file, add:
Instead of skip-networking The default is now-listen only onlocalhost which are more compatible and are not less secure.b ind-address = 127.0.0.1Remote Access to MySQL on port 3306Kallen Ding, June 11 2015
Bind-address = 0.0.0.0
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
LNMP Environment Construction-mysql Chapter