Check to see if the system has the MySQL-to-use command:
Rpm-qa | grep MySQL
To uninstall an installed mysql--> use command:
#rpm-E--nodeps mysql-libs-*
Delete all files under the/var/lib/mysql folder
MySQL Installation:
Execute command: Install Mysql-server
Yum-y Install Mysql-server
Execute initialization command after installation is complete
Service mysqld start or/etc/init.d/mysqld start
Modify the MySQL configuration file (Modify the default encoding)
Copy the my-large.cnf file to/etc/my.cnf and execute the command:
Cp/usr/share/doc/mysql-server-4.1.12/my-large.cnf/etc/my.cnf
If the hint is overwritten, Y can;
Open MY.CNF Modify the code--Execute command:
Vi/etc/my.cnf
Under [Mysqld], add:
Default-character-set=utf8
To modify the specified default engine:
Default-storage-engine=innodb
Case-sensitive: (0: Case-sensitive 1: case insensitive)
Lower_case_table_names=1
Under [client], add:
Default-character-set=utf8
4. Restart the MySQL service and execute the command:
Service mysqld restart or/etc/init.d/mysqld restart
5. Login to MySQL---execute command:
MySQL or mysql-uroot-p
View MySQL's encoding
Show variables like ' character% ';
Show:
+--------------------------+----------------------------+
| variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | UTF8 |
| character_set_connection | UTF8 |
| Character_set_database | UTF8 |
| Character_set_filesystem | binary |
| Character_set_results | UTF8 |
| Character_set_server | UTF8 |
| Character_set_system | UTF8 |
| Character_sets_dir | /usr/share/mysql/charsets/|
+--------------------------+----------------------------+
Successful modification;
Assign permissions to a host that is connected to MySQL (easy to connect to MySQL database remotely):
Mysql> Grant All on * * to ' username ' @ ' percent ' identified by ' password ' with GRANT OPTION;
Note that here is the SQL statement, not the Linux command Oh, it is not clear that this SQL statement can be Google.
Note: Modify the firewall to open port 3306;
Vi/etc/sysconfig/iptables
-A input-p tcp-m state--state new-m TCP--dport 3306-j ACCEPT
Restart service after saving
/sbin/service iptables Restart
After the installation is complete, set the root password for MySQL and use the command:
/usr/bin/mysqladmin-u root password ' 123456 '
To modify the MySQL root password:
SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' Newpass ');
MySQL installation directory description
/var/lib/mysql Database files
/usr/share/mysql commands and configuration files
/usr/bin (Mysqladmin, mysqldump and other commands)
centos6.5 installing MySQL