The following articles mainly introduce how to install MySQL and configure MySQL under the Linux operating system. We all know that many websites now use Linux + MySql. Although the steps for installing and configuring MySQL Databases in Windows are simple, installing MySQL in Linux is a little troublesome.
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:
Install MySQL:
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]
The default setting is an 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/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';
The above content is an introduction to installing and configuring MySQL in Linux. I hope you will gain some benefits.