In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will share with you the relevant knowledge points about the basic use of MySQL. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
MySQL is the most popular relational database management system, and MySQL is one of the best RDBMS (Relational Database Management System: relational database management system) applications in WEB applications.
Installation of MySQL
Download the installation file for MySQL
The following two files are required to install MySQL, which can be downloaded from the official website: MySQL-server-5.2.0-0.glibc23.i386.rpm MySQL-client-5.2.0-0.glibc23.i386.rpm
MySQL installation
The server and client installation commands are as follows:
[root@test1 local] # rpm-ivh MySQL-server-5.2.0-0.glibc23.i386.rpm [root@test1 local] # rpm-ivh MySQL-client-5.2.0-0.glibc23.i386.rpm
To test whether the installation is successful on the server side, you can run netstat to check whether the MySQL port is open. The default port is 3306. The command is as follows:
[root@test1 local] # netstat-natMySQL start and stop
Start
After the MySQL installation is completed, the startup file mysql is in the / etc/init.d directory. When you need to start, run the following command:
[root@test1 init.d] # / etc/init.d/mysql start
Stop and restart
Note: due to different versions may result in different orders, here only enumerate this version of the command, other versions please ask du Niang.
[root@test1 local] # service mysqld stop [root@test1 local] # service mysqld restartMySQL configuration
Several important catalogs
After MySQL is installed, unlike SQL server installed in a directory by default, its database files, configuration files and command files are in different directories. Here are several directories: 1. Database directory
/ etc/lib/mysql/
two。 Configuration file
/ usr/share/mysql (mysql.server commands and configuration files)
3. Related command
/ usr/bin (mysqladmin, mysqldump, etc.)
4. Startup script
/ etc/rc.d/init.d/
Change login password
MySQL does not have a password by default, and the importance of adding a password after installation is self-evident. 1. Command
Usr/bin/mysqladmin-u root password\ 'new-password'\
Format: mysqladmin-u user name-p old password password new password 2. Example (add password 123456 to root):
[root@test1 local] # usr/bin/mysqladmin-u root password 123456
Note: because root does not have a password at the beginning, the-p old password can be omitted.
Database backup and recovery
1. Backup database
Mysqldump-user=root-password=root password-lock-all-tables database name > backup file. Sql
two。 Restore the database
Mysql-u root-password=root password database name above is all the contents of this article "what are the basic uses of MySQL?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.