# yum install mysql mysql-server mysql-devel -y
2. check if mysqld is generated, and set autorun
# chkconfig --list |grep mysql
#chkconfig mysqld on
num 0-6: means the service level;
off: means not start mysqld when system started.
on: means start mysqld when system started.
3. run mysqld in two ways:
# /etc/init.d/mysqld start
# service mysqld start
check whether the mysqld is started:
#ps -elf |grep mysql |grep -v grep
we can see the datadir is /var/lib/mysql.
4. reset the password
#/usr/bin/mysqladmin -uroot password 'NewPassword'
#/usr/bin/mysqladmin -uroot -hhadoop1 password 'NewPassword'
5. shutdown mysqld
# /etc/init.d/mysqld stop
# service mysqld stop
6. restart mysqld
# /etc/init.d/mysqld restart
# service mysqld srestart