2009-03-25

About MySQL on Red Hat Enterprise Linux 4

Checking Installation

Use rpm command like following
root# rpm -q -a | grep mysql
mysql-server-4.1.12-3.RHEL4.1
mysql-4.1.12-3.RHEL4.1
php-mysql-4.3.9-3.8
mysql-devel-4.1.12-3.RHEL4.1

Installed Directory

  • Server program : /etc/init.d/mysql
  • Client programs (mysql, mysqladmin, mysqlshow, and so on) : /usr/bin/
  • Default config file : /etc/my.cnf
  • Data files : /var/lib/mysql/

Starting Server

Use the following command
root# /sbin/chkconfig mysqld on
root# /etc/init.d/mysqld start
root# ps -ef | grep mysql
The command executed by root account would delegate the execution of /usr/libexec/mysqld to mysql account.

Stopping Server

Use the following command.
root# /etc/init.d/mysqld stop

Resetting Root Password

When you forgot password of root user in MySQL, you can use the following commands after stopping the running process of mysqld if any.
mysql# /usr/bin/mysqld_safe --skip-grant-tables &
mysql# /usr/bin/mysqladmin -u root flush-privileges password "newpasswd"
After that restart the server in normal mode and you can connect as a root user using newpasswd. For more information, refer formal documentation of MySQL : How to Reset the Root Password

0 comments:

Post a Comment