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)06/01 Report--
# install mysql in binary, decompress and initialize the database directly
1. Create users and groups
[root@Lnmp tools] # useradd mysql-s / sbin/nologin/-M
two。 Extract the installation package
[root@Lnmp tools] # tar xf mysql-5.5.32-linux2.6-x86_64.tar.gz
[root@Lnmp tools] # mv mysql-5.5.32-linux2.6-x86_64 mysql
[root@Lnmp tools] # mv mysql / application/
# stand-alone installation of the database ends here.
[root@Lnmp tools] # mkdir-p / application/mysql/data/
[root@Lnmp tools] # chown-R mysql.mysql / application/mysql/data
3. Initialize the database
[root@Lnmp tools] # cd / application/mysql/
[root@Lnmp mysql] # / scripts/mysql_install_db-- user=mysql-- basedir=/application/mysql/-- datadir=/application/mysql/data/
WARNING: The host 'Lnmp' could not be looked up with resolveip.
This probably means that your libc libraries are not 100% compatible
With this binary MySQL version. The MySQL daemon, mysqld, should work
Normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
When specifying MySQL privileges!
Installing MySQL system tables...
OK
Filling help tables...
OK
[root@Lnmp mysql] #\ cp support-files/mysql.server / etc/init.d/mysqld
[root@Lnmp mysql] # cp support-files/my-small.cnf / etc/my.cnf # specify configuration file
# if it is not specified, it appears at startup:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket'/ var/lib/mysql/mysql.sock/ (2)
4. Start Mysql:
[root@Lnmp mysql] # / etc/init.d/mysqld start
/ etc/init.d/mysqld: line 276: cd: / usr/local/mysql: No such file or directory
Starting MySQL ERROR! Couldn't find MySQL server (/ usr/local/mysql/bin/mysqld_safe)
If not, modify the following:
[root@Lnmp mysql] # vi / etc/init.d/mysqld + 46
Basedir=/application/mysql
Datadir=/application/mysql/data
[root@Lnmp mysql] # / etc/init.d/mysqld start
Starting MySQL.. SUCCESS!
# Login
# mysql
The following error occurred:
#-bash:mysql:command not found
The path corresponding to mysql is not under the path directory.
Use the full path to enter mysql:
/ application/mysql/bin/mysql
Or add at the end of the document:
Vi / etc/profile
PATH= "/ application/mysql/bin/:$PATH"
#. / etc/profile # to make it effective
Mysql >
# set password, do not set password under mysql >, set password after #
/ application/mysql/bin/mysqladmin-u root password 'passwd123'
# sign in again
Mysql-u root-p
Passwd123
5. Data optimization:
Select version (); # View the database version
Select user (); # View current users
Mysql > show databases; # View the database
+-+
| | Database |
+-+
| | information_schema |
| | mysql |
| | performance_schema |
| | test |
+-+
Mysql > drop database test; # security settings, delete useless databases
# finally optimized as follows:
Mysql > show databases
+-+
| | Database |
+-+
| | information_schema |
| | mysql |
| | performance_schema |
+-+
Mysql > select user,host from mysql.user; # query the users in the table
+-+ +
| | user | host |
+-+ +
| | root | 127.0.0.1 | |
| | root |:: 1 |
| | Lnmp |
| | root | Lnmp |
| | localhost |
| | root | localhost |
+-+ +
Mysql > delete from mysql.user where (host= "Lnmp")
Mysql > delete from mysql.user where (host= ":: 1")
Mysql > drop user "" @ localhost
# finally optimized as follows:
Mysql > select user,host from mysql.user
+-+ +
| | user | host |
+-+ +
| | root | 127.0.0.1 | |
| | root | localhost |
+-+ +
Finally:
Flush privileges
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.