Mysql安装和环境变量设置及破解密码_MySQL
1、mysql安装
#usedel mysql
#groupdel mysql
#groupadd mysql
#useradd -g mysql mysql
#tar -zxvf mysql-5.1.55.tar.gz
#cd mysql-5.1.55
#./configure /
#>—prefix=/program/mysql / //安装路径
#>—localstatedir=/var/lib/mysql / //数据库文件存放路径
#>—with-comment=Source /
#>—with-server-suffix=-Community /
#>—with-mysqld-user=mysql /
#>—without-debug /
#>—with-big-tables /
#>—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 /
#>—enable-assembler /
#>—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 –add mysqld
#chkconfig –level 2345 mysqld on
#service mysqld restart
#/usr/local/mysql/bin/mysqladmin -uroot password “new_pass” //修改root用户密码
#netstat -nplt |grep mysql //查看mysql监听端口的信息
#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
>use msyqlmysql
>upadate user set password=password(“new_pass”) where user=”root”;
>flush privileges;
>exit
#service mysqld start#mysql -uroot -p //如果提示输入密码表明破解密码成功完成;
3、mysql环境变量的设置:
第一种:
#export PATH=$PATH:/usr/local/mysql/bin/
#export //查看环境变量
第二种:
#vi /etc/profileexport PATH=”$PATH:文件路径” //通过配置文件修改环境变量(需要注销系统才能生效)
#env //查看环境变量
第三种:
#vi /root/.bashrcexport PATH=”$PATH:文件路径” //修改root用户的环境变量(需要注销系统才能生效)
#echo $PATH //查看环境变量
bitsCN.com推荐阅读
-
Mysql安装和环境变量设置及破解密码_MySQL
-
在MySQL中修改密码及访问限制的设置方法详解
-
mysql 修改密码和设置允许远程登录
-
Ubuntu查看修改mysql的登录名和密码、安装phpmyadmin
-
Centos安装mysql数据库并修改密码设置远程登陆权限
-
MySql5.6使用validate password 插件加强密码强度的安装及使用方法
-
CentOS下安装mysql时忘记设置root密码致无法登录的解决方法
-
CentOS下安装mysql时忘记设置root密码致无法登录的解决方法
-
MySQL5.7.20解压版安装和修改root密码的教程
-
MySQL用户和权限及破解root口令的方法示例