Configuration of MySQL installation and remote connection configuration in Ubuntu 1. install MySQL in ubuntu and enter sudo apt-get install mysql-server in the ubuntu command line to install the mysql service, by default, mysql-client is automatically installed when mysql-server is installed. The mysql configuration file installed at www.2cto.com is located at/etc/mysql/my. the shortcut icon for cnf to start mysql is/etc/init. d/mysql 2. encoding solution view the current MYSQL character Set [run in mysql command line mode]: show variables like 'character % '; change the encoding: sudo vim/etc/mysql/my. cnf find [client] and add the following two sentences: // The default character set is utf8 default-character-set = utf8 find [mysqld] and add the following four sentences: (Note that each row cannot contain spaces) // The default character set is utf8 default-character-SET = utf8 // set utf8 encoding when connecting to the mysql database to run init_connect = 'set NAMES utf8' www.2c for the mysql database To.com finally switches to vim's last line mode and runs wq to exit the vim editor. stop Database Service: sudo/etc/init. d/mysql stop restart: s udo/etc/init. d/mysql start enter the database: mysql-uroot-p (your password) view the encoding: show variables like '% character %'; at this time, it should be all UTF-8 encoded. Iii. MySQL service to add boot auto start to boot auto start: sudo update-rc.d mysql defaults removed from boot auto start: sudo update-rc.d-f mysql remove IV. remote connection to MySQL vim/etc/mysql/my under ubuntu. cnf finds the bind-address = 127.0.0.1 line, comment out (below) # bind-address = 127.0.0.1 or change to bind-address = 0.0.0.0 to allow access by any IP address, or specify an IP address by yourself. Restart MySQL www.2cto.com sudo/etc/init. d/mysql restart authorize the user to remotely connect to grant all privileges on *. * to root @ "%" identified by "password" with grant option; flush privileges; the first line of the command is explained as follows ,*. *: The first * indicates the database name, and the second * indicates the table name. This means that all tables in all databases are authorized to users. Root: grant the root account. "%": Indicates that the authorized user's IP address can be specified. This indicates that any IP Address can access the MySQL database. "Password": password corresponding to the allocated account. Replace the password with your mysql root Account password. The second command is to refresh the permission information, that is, to make the settings take effect immediately. Now, you can remotely connect to MySQL In ubuntu.