one. Server-side1. Uninstall old version MySQL sudo apt-Get remove MySQL-Server2. Update the source server Software list sudo apt-GetUpdate 3. Restart the terminal to install MySQL4. Ubuntu on, off, restart MySQL services sudo service MySQL start sudo service mysql stop sudo service mysql restart or sudo/etc/Init.d/MySQL start sudo/etc/Init.d/MySQL stop sudo/etc/Init.d/MySQL Restart5. configuration file Default profile:/etc/Mysql/Mysql.conf.d/mysqld.cnf Bind-Address represents the server-bound IP, which connects to the server via this IP, can be configured as a different IP or not configured, the default is 127.0.0.1port, which defaults to 3306 DataDir represents the database directory, is configured to/var/Lib/MySQL Log_error represents the error log, configured as/var/Log/Mysql/Error.Logtwo. Client #1. Install connection and exit1, terminal installation MySQL client sudo apt-Get install MySQL-Client2. Help document MySQL-- Help 3. Connect MySQL mysql-Uroot-pmysql # mysql means password MySQL-Uroot-p re-enter the password4exit exit or quit or press CTRL+D #2. User Management|Special commands for user management: Creating usersCreateUsr'User name'@'IP Address'Identified by 'Password'; Delete UserDrop User 'User name'@'IP Address'; Modify User RenameUser 'User name'@'IP Address'; to 'New user name'@'IP Address';; Change PasswordSetPassword for 'User name'@'IP Address' =Password ('New Password') # 3. Rights Management|Rights Management: Default, no PermissionsGrantPermissions onDatabase. Table to 'User'@'IP Address' ----AuthorizationRevokePermissions onDatabase. Table from 'User'@'IP Address'----Cancel PermissionsShow grants for 'User'@'IP Address'----View Permissions# attached: The IP segment supports wildcard characters:%# Example:192.168. $.% # 4. Set additional Telnet root user rights1. To view the host of the root user, the default is only native IP (127.0.0.1) Login #SelectHostUser from User where User='Root'; 2. Update the root user information so that the root user can be logged on by any host IP #UpdateMysql.User SetHost= '%' where User = 'Root'; +------+------+ |Host| User | +------+------+ | % |Root| +------+------+ 3. Make changes effective # flushPrivileges; 4other hosts can telnet to the native MySQL root user,-h indicates the destination host IP # mysql for telnet-Uroot-Pmysql-H192.168. Xx.xxx5. View MySQL system tables #SelectHostUser fromMysql.User;
MySQL client and server-side operations | Mysql