Installation of mysql Databases on Linux operating systems and Problems

Source: Internet
Author: User

 

I. test environment:

1. VmwareWorkStation: 6.0.2 build-59824

2. Mysql database version:

Server: MySQL-server-5.5.19-1.linux2.6.i386.rpm

Customer: MySQL-client-5.5.19-1.linux2.6.i386.rpm

3, need plug package: libaio-0.3.105-2.i386.rpm

4. Linux version: RedHat Linux AS 4

Ii. Install

1. [root @ ssbsc mysql] # rpm-ivh libaio-0.3.105-2.i386.rpm

2, [root @ ssbsc mysql] # rpm-ivh MySQL-server-5.5.19-1.linux2.6.i386.rpm

3, [root @ ssbsc mysql] # rpm-ivh MySQL-client-5.5.19-1.linux2.6.i386.rpm

Iii. Verification

Run the netstat-nat command to verify whether the mysql database has been started.

[Root @ ssbsc mysql] # netstat-nat

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address Foreign Address State

Tcp 0 0: 3306: * LISTEN

It is observed that port 3306 of the Local Address has been enabled, indicating that the service has been started. If the service has not been started, run the following command to enable it:

[Root @ ssbsc mysql] # service mysql start

Starting MySQL... [OK]

4. log on to MySQL

The command used to log on to MySQL is mysql. the syntax of mysql is as follows:

Mysql [-u username] [-h host] [-p [password] [dbname]

Username and password are the usernames and passwords of MySQL respectively, and the initial management account of mysql is root without a password. I have set a password here, so I use a password to log on.

[Root @ ssbsc mysql] # mysql-u root-p

Enter password:

Welcome to the MySQL monitor. Commands end with; or \ g.

Your MySQL connection id is 2

Server version: 5.5.19 MySQL Community Server (GPL)

Copyright (c) 2000,201 1, Oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of Oracle Corporation and/or its affiliates. other names may be trademarks of their respective owners.

Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.

Mysql>

If mysql> is displayed as shown above, it indicates that you have successfully logged on.

5. Use Navicat for MySQL on Windows to log on to the Mysql database just installed on Linux.

Common problems:

Error1: 2003: Can't connect to MySQL server on 'localhost'

Solution: Disable the firewall function of Linux or enable port 3306 of TCP. Run the following command to enable port 3306 of TCP.

[Root @ bugzilla ~] # More/etc/sysconfig/iptables

-A RH-Firewall-1-INPUT-p tcp -- dport 3306-j ACCEPT

Error2: 1130-Host 'clientip' is not allowed to connect to this MySQL server

Solution: Use the root user to log on to Linux, log on to the root user of MySQL, and change the allowed IP address range.

[Root @ bugzilla ~] # Mysql-u root-p

Mysql> grant all privileges on *. * to 'root' @ '%' identified by 'your password' with grant option;

This command allows all hosts that use the root user to enter the password to log on to the mysql server. If you change '%' to '192. 168.1.208 ', only the hosts of '192. 168.1.208' can log on to the mysql server.

 

From the column of cold and snow marks

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.