CentOS under Install mysql,windows using Navicat for MySQL connection

Source: Internet
Author: User

Install to see if it has been installed:
Yum List installed mysql*
Rpm-qa | grep mysql*

To see if there are any installation packages:
Yum List mysql*

Install Mysqlclient:
Yum install MySQL

To install the MySQL server side:
Yum Install Mysql-server
Yum Install Mysql-devel

Start && Stop database character set settings

/etc/my.cnf in the [mysqld] configuration section of MySQL configuration file? default-character-set=utf8

Sometimes the configuration file may be in/usr/my.cnf, if it is not found, use the following command to find:

Find-name my.cnf

Method: Vi/etc/my.cnf, by moving the cursor around the next key, press the letter "I" into the editing state, Shift + Insert paste content (I am xshell operation), press ESC to enter the command mode, enter ": Wq" press ENTER.


To start the MySQL service:
Service mysqld start or/etc/init.d/mysqld start
Boot start:
Chkconfig-add mysqld, check if boot boot settings are successful chkconfig--list | grep mysql*

Mysqld 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off
Stop it:
Service Mysqld Stop

Log in to create the root administrator:
Mysqladmin-u Root Password 123456
this does not run through, hint: Mysqladmin:can ' t turn off logging; Error: ' Access denied; you need the SUPER privilege for this operation '
Login:
Mysql-u root-p You can enter the password.
Forgot Password:
Service Mysqld Stop

Mysqld_safe--user=root--skip-grant-tables

After running this statement, no more commands can be entered.

Output: 140616 19:23:09 mysqld_safe Logging to '/var/log/mysqld.log '.
140616 19:23:09 Mysqld_safe starting mysqld daemon with databases From/var/lib/mysql

After that, it stops there and needs to open the terminal to run the command;

Mysql-u Root

Use MySQL;

Update user set Password=password (' 123456 ') where user= ' root ';

Flush privileges;
But running out of these commands does not solve the problem of using Navicat for MySQL connection under Windows;

Remotely access the port number of the open firewall, or turn off the firewall;
MySQL add? permissions: The user table in the MySQL library adds a record of host "%" and user as "root".

This test is no use;

Several key folder database folders for Linux MySQL
/var/lib/mysql/
Configuration file
/usr/share/mysql (mysql.server command and configuration file)
Related commands
/usr/bin (Mysqladmin mysqldump and other commands)
Startup scripts
/etc/rc.d/init.d/(startup script file for MySQL folder)

Using Navicat for MySQL connection under Windows

Error: 1130 host is not allowed to connect to this MySQL server

Workaround:

1. Change the table method.

It may be that your account does not agree to log on remotely, only on localhost. This time only on the localhost computer, log in MySQL, the "MySQL" Database in the "User" table "host" item, from "localhost" to "%"

Mysql-u root-pvmwaremysql>use MySQL;

Mysql>update User Set host = '% ' where user = ' root ';

Mysql>select host, user from user;

2. Authorization law.

For example, you want to myuser use MyPassword to connect to MySQLserver from whatever host.

GRANT all privileges on * * to ' myuser ' @ ' percent ' identified by ' MyPassword ' with GRANT OPTION;

FLUSH privileges;

This test pass, just remember the changes in the statement "MyUser" and "MyPassword", I just took it to run directly, the results of a half a day to find.

Suppose you want to agree to user MyUser connect to MySQLserverfrom the IP 192.168.1.6 host and use MyPassword as the password

GRANT all privileges on * * to ' myuser ' @ ' 192.168.1.3 ' identified by ' MyPassword ' with GRANT OPTION;

FLUSH privileges;

Suppose you want to agree to user MyUser connect to the MySQLserver 's DK database from the IP-192.168.1.6 host and use MyPassword as the password

GRANT all privileges the dk.* to ' myuser ' @ ' 192.168.1.3 ' identified by ' MyPassword ' with GRANT OPTION;

FLUSH privileges;

Run on the machine where MySQL is installed:

1, d:\mysql\bin\>mysql-h localhost-u root//This should be able to enter the MySQLServer

2, Mysql>grant all privileges on * * to ' root ' @ '% ' with GRANT OPTION//grant access to data regardless of host

3, Mysql>flush privileges//change effective

4, Mysql>exit//Exit MySQLServer

This will allow you to log in as root on any other host, regardless of the status.

CentOS under Install mysql,windows using Navicat for MySQL connection

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.