Heim  >  Artikel  >  Datenbank  >  MySQL-Installation und Umgebungsvariableneinstellungen sowie Passwortknacken

MySQL-Installation und Umgebungsvariableneinstellungen sowie Passwortknacken

高洛峰
高洛峰Original
2016-12-02 14:31:321270Durchsuche

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

#> – Präfix= /program/mysql                 //安装路径

#> – localstatedir=/var/lib/mysql         //数据库文件存放路径

#> – with-com ment=Quelle

#> – 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 passwort „new_pass“  //修改root用户密码

 

#netstat -nplt |grep mysql            //查看mysql监听端口的信息

 

#ps -aux |gre p 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 verwenden

 

>Benutzer aktualisieren set password=password(“new_pass”) where user=“root“;

 

>flushprivilegien;

 

>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  //查看环境变量

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn