当前位置:网站首页>Linux installs MySQL in RPM (super simple)
Linux installs MySQL in RPM (super simple)
2022-04-23 18:10:00 【dawnsun001】
Reference documents :http://blog.csdn.net/superchanon/article/details/8546254
RPM Installation steps
a. Check that... Is installed ,grep Of -i Option means ignore case when matching
[[email protected] JavaEE]#rpm -qa|grep -i mysql
mysql-libs-5.1.61-4.el6.x86_64
It can be seen that the library file has been installed , You should uninstall , Otherwise, an overwrite error will occur . Note that... Is used during uninstallation --nodeps Options , Ignoring dependencies :
[[email protected] JavaEE]#rpm -e mysql-libs-5.1.61-4.el6.x86_64 --nodeps
2. install MySQL Server side software for , Notice the switch to root user :
[[email protected] JavaEE]#rpm -ivh MySQL-server-5.5.29-2.el6.x86_64.rpm
After installation , The installation process will Linux Add a mysql Group , And belong to mysql Group users mysql. It can be done by id Command view :
[[email protected] JavaEE]#id mysql
uid=496(mysql)gid=493(mysql) groups=493(mysql)
MySQL After the server is installed, although the relevant files are configured , But it didn't start automatically mysqld service , It needs to start by itself :
[[email protected] JavaEE]#service mysql start
Starting MySQL.. SUCCESS!
You can check whether the port is open MySQL Whether it starts normally :
[[email protected] JavaEE]#netstat -anp|grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 34693/mysqld
c. install MySQL Client software :
[[email protected] JavaEE]#rpm -ivh MySQL-client-5.5.29-2.el6.x86_64.rpm
If the installation is successful, you should be able to run mysql command , Note that it must be mysqld Service and opening :
[[email protected] JavaEE]#mysql
Welcome to the MySQLmonitor. Commands end with ; or \g.
Your MySQL connection idis 1
Server version: 5.5.29MySQL Community Server (GPL)
Copyright (c) 2000, 2012,Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademarkof Oracle Corporation and/or its affiliates. Other names may be trademarks oftheir respective owners.
Type 'help;' or '\h' forhelp. Type '\c' to clear the current input statement.
mysql>
d. RPM Installation mode file distribution
Directory |
Contents of Directory |
/usr/bin |
Client programs and scripts |
/usr/sbin |
The mysqld server |
/var/lib/mysql |
Log files, databases |
/usr/share/info |
Manual in Info format |
/usr/share/man |
Unix manual pages |
/usr/include/mysql |
Include (header) files |
/usr/lib/mysql |
Libraries |
/usr/share/mysql |
Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation |
/usr/share/sql-bench |
Benchmarks |
Set the username and password :
mysql> select user,host from mysql.user;
+---------+-----------+
| user | host |
+---------+-----------+
| M1234 | % |
....
| root | localhost |
+---------+-----------+
4 rows in set (0.00 sec)
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit
c:> mysql -uroot -p
Enter password: < Enter the new password newpassword>
Reference documents :http://blog.csdn.net/feng4656/article/details/9879591
Navicat windowns Lower remote connection linux Terminal mysql
We need to build up to Linux On MySQL Links to servers , Create a link , Name the link name , Fill in the server IP, Login user and password , And then link ~ It is possible that there will be an error when linking , Said there was no authorization , Be similar to Host '192.168.1.3' is not allowed to connect to this MySQL server Error of ~
The reason for this error is that there is no open remote link function , Can be in mysql The user is authorized in the client of the named row , For example, use command GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY ’password’ WITH GRANT OPTION; Yes root The user authorizes , Then you can link successfully ~
linux mysql Change user permissions
Reference documents http://www.jb51.net/LINUXjishu/10981.html
ERROR 1045 : Access denied for user [email protected] (using password: YES)
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: < Enter the new password newpassword>
mysql>
Method 2 :
Use it directly /etc/mysql/debian.cnf In file [client] The user name and password provided in Section :
# mysql -udebian-sys-maint -p
Enter password: < Input [client] Password for section >
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit
# mysql -uroot -p
Enter password: < Enter the new password newpassword>
mysql>
Method 3 :
I haven't tested this method , Because of my root The user's default password has been changed by me , Who has time to test , Tell me the results , thank you !
# mysql -uroot -p
Enter password: < Input /etc/mysql/debian.cnf In file [client] The password provided in Section >
thus , The long confused problem has been solved !
Starting MySQL......./etc/init.d/mysql: line 159 kill : ( ) - Without that process
http://blog.csdn.net/chunkyo/archive/2006/04/21/671347.aspx, To solve the problem . Thank you very much to the technicians who share the information !
1.#cp /etc/init.d/mysql /etc/init.d/mysql.bak # Copy /etc/init.d/mysql To /etc/init.d/mysql.bak file
2.#/etc/init.d/mysql.bak start # perform /etc/init.d/mysql.bak File to start the mysql success !!!
3.# rm /etc/init.d/mysql # Delete /etc/init.d/mysql file
4.# mv /etc/init.d/mysql.bak /etc/init.d/mysql # take /etc/init.d/mysql.bak Rename it to /etc/init.d/mysql
5.#/etc/init.d/mysql start # perform /etc/init.d/mysql start-up mysql success !
版权声明
本文为[dawnsun001]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230544289234.html
边栏推荐
猜你喜欢
随机推荐
Docker 安裝 Redis
.105Location
Realization of consumer gray scale
Closure type of rust (difference between FN, fnmut and fnone)
Read excel, int digital time to time
.105Location
Data stream encryption and decryption of C
Docker 安装 MySQL
Implementation of object detection case based on SSD
【ACM】376. 摆动序列
C language array processing batch data
【ACM】70. 爬楼梯
Logic regression principle and code implementation
Docker 安装 Redis
Reptile efficiency improvement method
Robocode tutorial 7 - Radar locking
journal
C language to achieve 2048 small game direction merging logic
Using files to save data (C language)
Secure credit