Install and configure mysql SQL code in suse rpm-qa | grep mysql
Check whether mysql has been installed, or check whether mysql has been installed in yast. I indicates that yast has been installed.> software Management --> Filters: Select RPM Groups --> Applications. If yes uninstall, run the rpm-ivh mysql-server *** command in yast to uninstall the Linux code ***. rpm install mysql Server rpm-ivh Mysql-client ***. ps-ef | grep mysql after the rpm installation of mysql client Linux code is complete to check whether mysql is started or not./etc/init. d/mysql start mysql and mysql press enter to enter mysql without a password by default. If you need to change the password, run the mysql logon to linux Command to change the root password to root: SQL code mysqladmin-uroot password 'root' allows remote logon to mysql: SQL code grant all privileges on *. * to root @ '%' identified by 'root'; flush privileges; check mysql startup status: Linux code chkconfig -- list | grep mysql 0: off 1: off 2: on 3: on 4: on 5: on 6: off 3 and 5: on indicates the command line status and graphical interface status. By default, mysql is started. You do not need to modify the mysql character set encoding: log on to mysql and check that: show variables like 'character % '; show variables like 'collation %'; mysql> show variables like 'character % '; + bytes + | Variable_name | Value | + bytes + | character_set_client | utf8 | character_set_connection | utf8 | character_set_database | latin1 | bytes | binary | bytes | utf8 | | character_set_server | latin1 | character_set_system | utf8 | character_sets_dir |/usr/share/mysql/charsets/| + rows + 8 rows in set (0.00 sec) mysql> show variables like 'collation % '; + rows + | Variable_name | Value | + rows + | collation_connection | rows | collation_database | latin1_swedish_ci | collation_server | latin1_swedish_ci | + rows + 3 rows in set (0.00 sec) to prevent garbled characters, modify the database code to UTF-8, copy one of the my-small.cnf, my-medium.cnf, my-large.cnf, and my-huge.cnf under the mysql installation path to/etc/and rename it my. cnf where the copy needs to follow the machine configuration and database connection pressure, I copied a my-medium.cnf file, the command is: cp/usr/share/mysql/my-medium.cnf/etc/my. cnf edit my. cnf file: vi/etc/my. cnf is added under [mysqld]: character_set_server = utf8collation-server = utf8_bininit_connect = 'set NAMES utf8' added under [client]: default-character-SET = utf8 added under [mysql: default-character-set = utf8 save and exit, then restart mysql service:/etc/init. d. restart mysql restart or service mysql restart. log on to mysql and check the encoding: mysql> show variables like 'character % '; + bytes + | Variable_name | Value | + bytes + | character_set_client | utf8 | character_set_connection | utf8 | character_set_database | utf8 | bytes | binary | utf8 | | character_set_server | utf8 | character_set_system | utf8 | character_sets_dir |/usr/share/mysql/charsets/| + rows + 8 rows in set (0.00 sec) mysql> show variables like 'collation % '; + rows + | Variable_name | Value | + rows + | collation_connection | utf8_general_ci | collation_database | utf8_bin | collation_server | utf8_bin | + rows + 3 rows in set (0.01 sec) so far, the default encoding of mysql has been modified.