#1210
[MySQL] How-To
Install MySQL (new version)on CentOS
Download RPM file from : https://dev.mysql.com/downloads/repo/yum/
Install repo :
sudo yum localinstall platform-and-version-specific-package-name.rpm
Check repo is installed :
yum repolist enabled | grep "mysql.*-community.*"
Install MySQL :
yum install mysql-server
Start/Stop MySQL Server :
service mysql start service mysql stop service mysql restart service mysql status
Connect to MySQL
mysql -u root -p
Select database
use DATABASE_NAME;
List all tables
show tables;
Repair a table
repair table TABLE_NAME;
MariaDB
[CSS] Word wrap [Unix] Verifying Which Ports Are Listening
my.cnf : http://www.fromdual.com/mysql-configuration-file-sample
For error “InnoDB: Unable to lock ./ibdata1, error: 11”
#1. Stop MySQL
#2. Go to MySQL folder
#3.
#4.
#5. Start MySQL
To (re) set the root password after installation :
Create an init file containing :
Start MySQL using :
As of 5.7 :
https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html#yum-repo-starting-and-stopping-server
to remove a plugin (for example validate_password)
as mysql root user :
uninstall plugin validate_password;
To change the MySQL Unix User owner (to replace root)
#1. Stop MySQL Server (as root)
#2. As root, start MySQL using :
mysqld –user=<MYSQL_UNIX_USER>
#3. As MYSQL_UNIX_USER stop and then start MySQL Server.
Add a new user to MySQL database :