Linux installation configuration and use of MySQL database

Source: Internet
Author: User
Tags administrator password

Linux installation configuration and use of MySQL database

Linux installation in the development of often need to use to MySQL database, the following Linux system for example, how to install MySQL database, how to enable/stop, stop MySQL service, how to modify the MySQL database configuration file, How to log in to the MySQL database and modify the root user password.

1) Check if the system has MySQL installed
In terminal console input: sudo netstat-tap | grep MySQL
or enter: mysql–version
"Explanation" The first instruction is to retrieve MySQL, the second instruction is to query the installation version of MySQL, based on the return information to judge.

2) Install MySQL database
In terminal console input: sudo apt-get install mysql-server mysql-client
The installation process will pop up a dialog box, prompting the need to set the database root user management password, when prompted to enter!

3) test whether the installation is successful, repeat the first step!

4) log in to MySQL
In terminal console input: Sudo-u root-p
Enter the password when logging in, enter the correct root user password at this time!

5) Start and stop MySQL service
Start service command: sudo start MySQL
Stop service directive: sudo stop MySQL

6) Modify the MySQL administrator password
Modified instruction: sudo mysqladmin-u root password newpassword

7) Telnet (listening port)
By default, MySQL listens only to port 3306 on the local host IP address (127.0.0.1), and modifies its parameters by modifying the my.cnf configuration file.
Such as:
Open configuration file: sudo cat/etc/mysql/my.cnf
You can block local IP address snooping by using the # # notation, commenting bind-address= 127.0.0.1 statements.

8) MySQL configuration file related directory
# Database Storage directory:/var/lib/mysql/
# Startup Footstep Storage directory:/etc/rc.d/init.d/
# Related configuration file directory:/usr/share/mysql
# Related Command storage directory:/usr/bin (mysqladminmysqldump, etc command)
 
9) MySQL graphical management software
Mysqlworkbench
Navicat
phpMyAdmin

Linux installation configuration and use of MySQL database

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.