1、mysqlAn装
#usedel mysql
#groupdel mysql
#groupadd mysql
#useradd -g mysql mysql
#tar -zxvf mysql-5.1.55.tar.gz
#cd mysql-5.1.55
#./configure
#>—접두사= /program/mysql //安装路径
#>—localstatedir=/var/lib/mysql //数据库文件存放路径
#>—with-comment=Source
#>—with-server-suffix=-Community
#>—with-mysqld-user=mysql
#>—디버그 없음
#>—큰 테이블 포함
#>—with-charset=utf8
#>—with-collation=utf8_unicode_ci
#>— with-extra-charsets=all
#>—with-pthread
#>—enable-static
#>—enable-thread-safe-client
#>—with-client-ldflags=-all-static
#>—with-mysqld-ldflags=-all-static
#>— 활성화-어셈블러
#>—without-innodb
#>—with-innodb
#> —without-isam
#>—without-ndb-debug
#>—with-unix-socket-path=/ var/lib/mysql/mysql.sock
#make && make install
#cp ./support-files/my-medium. cnf /etc/my.cnf
#/usr/local/mysql/bin/mysql_install_db —user=mysql
#chown mysql: mysql -R /usr/local/mysql
#chgrp -R mysql /usr/local/mysql
#/usr/local/ mysql/bin/mysqld_safe —user=mysql &
#chmod +x ./support-files/mysql.server
#cp . /support-files/mysql.server /etc/init.d/mysqld
#chkconfig –mysqld 추가
#chkconfig –level 2345 mysqld on
#service mysqld restart
#/usr/local/mysql/bin/mysqladmin -uroot 비밀번호 “new_pass” //修改root용户密码
#netstat -nplt |grep mysql //查看mysql监听端TED信息
#ps -aux |grep mysql / /查看mysql运行的进程信息
2、mysql密码恢复
#service mysqld stop
#killall -TERM mysqld
#/usr/local/mysql/bin/safe_mysqld —skip-grant-tables &
#/usr/local/mysql/bin/mysq/mysql
>msyqlmysql 사용
>upadate 사용자 set password=password(“new_pass”) 여기서 user=”root”;
>flush 특권;
>exit
#service mysqld start#mysql -uroot -p //如果提示输入密码表明破解密码成功完成;
3、mysql环境变용량의 내용:
第一种:
#export PATH=$PATH:/usr/local/mysql/ bin/
#export //查看环境变weight
第二种:
# vi /etc/profileexport PATH=”$PATH:文件路径” //일반적으로过配置文件修改环境变weight(需要注销系统才能生效)
#env //查看环境变weight
第三种:
#vi /root/.bashrcexport PATH=”$PATH:文件路径” //修改root사용户的环境变(需要注销系统才能生效)
#echo $PATH //查看环境变weight