View MySQL in Linux

Source: Internet
Author: User

1. Installation
Check whether MYSQL is installed in Linux.
Rpm-qa mysql

Mysql-4.1.7-4.RHEL4.1

Click add/remove mysql detail in programe.
Check mysql-server

2. Start
To check whether mysql has been started.
Service mysqld status

We can start Mysql in three ways:
Method 1: use the service command
Start Mysql
Service mysqld start
Stop mysql
Service mysqld stop
Method 2: Use the mysqld script to start Mysql:
/Etc/init. d/mysql start
Method 3: Use the safe_mysqld utility to start the Mysql service.
Safe_mysqld & // use & to put safe_mysqld in the background for execution.

3. Login
Change Password
Mysqladmin-u root password
Mysqladmin-u root password 'kaishi'

The "password" here is the new password. The system will prompt us to enter the old password (if mysql is just installed, the default password is blank)

You can log on to the local machine. However, an error is reported during client login on other machines.
ERROR 1130 (00000): Host 'xxx. xxx. xxx. XXX' is not allowed to connect to this MySQ
L server

First, check the settings of iptables and add and open port 3306.
Iptables-a input-p tcp-m tcp -- sport 3306-j ACCEPT
Iptables-a output-p tcp-m tcp -- dport 3306-j ACCEPT

Service iptables save
Service iptables restart

Or other machines cannot be accessed. It is estimated that the MYSQL permission is a problem.

Log on to the Local Machine
Mysql-h localhost-u root-pkaishi
Show databases;
Use mysql;
Select Host, User, Password from user;
+ ----------------------- + ------ + ------------------------------------------- +
| Host | User | Password |
+ ----------------------- + ------ + ------------------------------------------- +
| Localhost | root | * 18F54215F48E644FC4E0F05EC2D39F88D7244B1A |
| Localhost. localdomain | root |
| Localhost. localdomain |
| Localhost |
+ ----------------------- + ------ + ------------------------------------------- +
We can see that the access permission is set only for localhost.

  • 1
  • 2
  • Next Page

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.