Install MySQL and Windows installation configuration SQLyog in Ubuntu Linux system

Source: Internet
Author: User
Tags mysql in iptables

One Linux system installation MySQL

Ubuntu installed on MySQL is very simple and requires just a few commands to complete.

1. sudo apt-get install Mysql-server

2. Apt-get Isntall mysql-client

3. sudo apt-get install Libmysqlclient-dev

During installation, you will be prompted to set a password or something, note that the settings do not forget that after the installation is complete, you can use the following command to check if the installation is successful:

sudo netstat-tap | grep MySQL

after checking with the above command, if you see a socket with MySQL in the Listen state, the installation is successful.

log in to MySQL database by the following command:

Mysql-u root-p

-U means to select the login user name,-p indicates the login user password, the above command input will prompt for a password, then enter the password can log in to MySQL.

then through show databases; You can view the current database.

we choose the MySQL database to do the next step, using the use MySQL command, display the current database form: Show tables

First, install and configure sqlyog (MySQL database graphical operation tool)

Download and install SQLyog not much to say, relatively simple, but it is necessary to register, on Baidu search SQLyog registration code, you can have a lot of activation code can be registered;

The main point here is SQLyog How to connect the MySQL server on the virtual machine after the installation is complete; The normal connection is:

The host address is the IP address of your virtual machine system , after filling in the username and password, the port default is 3306, test connection;

will report an exception, unable to connect to your MySQL server;

If you want to remotely log on to Ubuntu or debian MySQL to change the settings of 2 places , One of them is MySQL configuration file , and the other is the MYSQL permissions setting ;

1.mysql configuration

, if you appear

Can ' t connect to MySQL server on ' 192.168.10.18′ (10061)

See here the is MYSQL 10061 wrong ? is because, MySQL default configuration to enhance security, prohibit non-native access, Ubuntu in this way, Debian , too. The Forbidden Way was previously in the my.cnf There was a sentence

Skip-network

Now it becomes:

# Instead of skip-networking The default is now-listen only on # localhost which are more compatible and are not less sec Ure. Bind-address = 127.0.0.1

is to listen only to the native address. Therefore, if you want to open the LAN access, you need to comment out this sentence, or change to:

bind-address = 0.0.0.0 on the line.

Next , add the rules to iptables so that the mysql 3306 Port can be accessed to

[email protected]: # iptables-a input-p TCP--dport 3306-j ACCEPT

so We can start listening to the 3306 port.

1. MYSQL permissions Settings

3306 Port began to listen , but MYSQL permissions have not opened the ROOT remote login;

Mysql does not allow remote connections by default, because there are a lot of security implications.

you need to manually increase the remote access Database the user.

[Email protected]: #mysql-uroot-p Then set remote access permissions for MySQL, such as under, where ' password ' is the password for your MySQL root mysql> Grant all Privileges on * * to ' root ' @ '% ' identified by ' password′;

Third, after the setup is complete, restart the MySQL service:

How to start / stop / restart MySQL

First, starting mode

1. Start with service :service MySQL start

2. Start with mysqld script:/etc/inint.d/mysql start

3, use safe_mysqld start:safe_mysql&

Second, stop

1. Start with service :service MySQL stop

2. Start with mysqld script:/etc/inint.d/mysql Stop

3,mysqladmin shutdown

Third, restart

1. Start with service :service mysql restart

2. Start with mysqld script:/etc/inint.d/mysql Restart

of course, after the restart,SQLyog should have been able to connect successfully;

Install MySQL and Windows installation configuration SQLyog in Ubuntu Linux system

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.