In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces you how to set Mysql environment variables, the content is very detailed, interested friends can refer to, hope to be helpful to you.
1. Mysql installation
# 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\ / / installation path
# >-localstatedir=/var/lib/mysql\ / / File storage path
# >-with-comment=Source\
# >-with-server-suffix=-Community\
# >-with-d-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" / / modify root user password
# netstat-nplt | grep mysql / / View the information of mysql listening port
# ps-aux | grep mysql / / View the process information that mysql is running
2. Mysql password recovery
# 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 / / if prompted for a password, the password cracking is completed successfully
3. Setting of mysql environment variable:
The first kind:
# export PATH=$PATH:/usr/local/mysql/bin/
# export / / View environment variables
The second kind:
# vi / etc/profileexport PATH= "$PATH: file path" / / modify the environment variable through the configuration file (you need to log out of the system to take effect)
# env / / View environment variables
The third kind:
# vi / root/.bashrcexport PATH= "$PATH: file path" / / modify the environment variables of root users (you need to log out of the system to take effect)
# echo $PATH / / View environment variables
On how to set Mysql environment variables to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.