MySql is one of the developers' favorite database systems. installing and configuring MySql databases has become a topic of interest. Especially for non-Windows installation, it is a headache for many people.
Many websites now use Linux + MySql. MySql is easy to install and configure in Windows, but it is a little troublesome to install MySql database in Linux. For Linux beginners who are familiar with Windows, it is really "quite" troublesome!
Follow these steps to install MySql in Red Hat Enterprise Linux AS 4.0:
Download MySQL:
From http://dev.mysql.com/downloads/mysql/5.0.html
Download Red Hat Enterprise Linux 4 RPM (x86): MySQL-server-standard-5.0.27-0.rhel4.i386.rpm
Install MySql database:
Rpm-ivh MySQL-server-standard-5.0.27-0.rhel4.i386.rpm -- nodeps -- force
Modify/etc/my. cnf as needed. Refer to the Configuration:
[Mysqld]
# Set the default value to the INNODB table, which supports transactions and row locks:
Default-storage-engine = INNODB
# Set the default character set:
Default-character-set = utf8
# Maximum buffer size used for client communication
Max_allowed_packet = 16 M
Start MySQL:
Service mysql start
/Etc/init. d/mysql start
/Usr/share/mysql. server start
[Mysql. server]
# Comment out the basedir line; otherwise, MySql may not be able to start
# It is said to be a MySql bug
# Basedir =/var/lib
Enable the MySQL system to start automatically:
Check MySql in system Settings> Server Settings> service.
When the root user logs on, mysql is automatically started:
Add one line to the/root/. bash_profile file:
/Usr/share/mysql. server start
View the startup log:
/Var/log/messages
Show all MySQL users:
Use mysql;
Select host, user, password from user;
Add a MySQL user (user name: user1, password: SQL ):
Grant all on *. * to user1 @ '%' identified by 'SQL' with grant option;
Delete a MySQL user:
Delete from user where user = 'user1 ';
Back up data based on Mysql tables
MySQL Show statement usage
How to clear a table in Mysql
Command for viewing the Mysql table structure
MySQL connection query Overview