MySQL client and server-side operations | Mysql

Source: Internet
Author: User
Tags mysql client

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.