Mysql
Knowledge section
Summary: MySQL is a real multi-threaded, multi-user SQL database system. With its high performance, reliability and ease of use, she has become the most popular database system in the server world. Prior to 2008, the MySQL project was developed, released and supported by MySQL, and after Sun acquired MySQL AB, Oracle acquired Sun, which currently operates and maintains the MySQL project.
installation process
1, preparation, in order to avoid program conflicts or port conflicts, we can check the installation of MySQL software. If there is already a RPM installed MySQL software, we need to uninstall it.
2. Install Red Hat Ncurses-devel bag
3. Create MySQL running user, the user belongs to the MySQL group, cannot log into the system
4, installation of MySQL needs to be configured with CMake. So we also need to install the CMake package. (Note: 1, install cmake also need to use gmake compile and install, 2, CMake installation time is longer, need to wait patiently)
5. Unpacking
6, configure the installation. Each of these options means:
-dcmake_install_prefix: Install MySQL in the specified directory
-dsysconfdir: Specifies the directory where the parameter files are initialized
-ddefault_charset: Specifies the default character set encoding, such as UTF8
-ddefault_collation: Specifies the default character set collation rules, such as Utf8_general_ci
-dwith_extra_charsets: Specifies the additional supported character set encoding
7. Compiling and installing
8. Post-Installation adjustment: Authorization settings for the database directory
9. Set up the configuration file. (A sample configuration file for different load databases is provided under Support-files in the MySQL source directory.) Generally we choose MY-MEDIUM.CNF, the action is to copy the file to/ETC/MY.CNF. If the file exists under/etc, it can be deleted after copying)
10. Initialize the database
11, set environment variables, and directly execute/etc/profile let it take effect
12, add MySQL for system services, easy to open services. , "OK" appears, indicating that MySQL is already started. (Note: MySQL default port number is 3306)
13, add MySQL command.
Login MySQL mysql-u user-p interactive interface Enter the password
Creating a library Create Database
Creating Tables CREATE TABLE Table (...)
drop table Database,table
Grant permission list on database,table to [email protected] [identified by ' passwd ']
14. Replenish the database backup commands.
Mysqldump-u user-p--opt--all-databases > Name.sql back up all databases
Mysqldump-u user-p--opt--databases database > Name1.sql backing up individual databases
Lamp Platform Building-mysql Chapter