1. delete mysql
Sudo apt-get autoremove mysql-server
Sudo apt-get remove mysql-common
2. install
Sudo apt-get install mysql-server
Sudo apt-get install php5-mysql
Configuration:
The MYSQL we just installed has only one default root user, and there is no password. At this time, we must set a password root for MYSQL.
Terminal input:
Mysql-u root-p
Mysql> enter password: root
Mysql> \ q exit mysql
3. Add a user, set the password, and have all permissions for the redmine_default database.
Mysql> grant all privileges on redmine_default. * to 'redmine '@ 'localhost' identified by 'redmine ';
4. How to save the mysql root Password
Run as root
-1. End the currently running mysql process.
#/Etc/init. d/mysql stop
-2. Run in mysql security mode and skip permission verification.
#/Usr/bin/mysqld_safe -- skip-grant-tables
-3. log on to mysql as the root user.
# Mysql-u root
-4. Modify the root user password.
Mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with-
Database changed
Mysql> update user set Password = PASSWORD ('root') where User = 'root ';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
Mysql> exit
-5. End mysql security mode and run mysql in normal mode.
#/Etc/init. d/mysql restart
Note:
Mysql server creates a default mysql database, where a data item manages the account and password information of each user. All database data managed by the server is stored under/var/lib/mysql/. As long as the data below is not deleted, even if mysql is re-installed, the mysql database can still be accessed after being reinstalled.