Uninstall mysql: RPM -e -- nodeps XXXXX;
Check whether there is residual: the find/-name mysql;
Unpack the installation package: tar ZXVF - XXXXX;
Mobile rename: mv XXXXX installation path;
Checking for mysql groups: cat/etc/group | grep mysql; (do not create groupadd mysql)
See if the mysql user: cat/etc/passwd | grep mysql; (do not create useradd mysql - s - r - g/bin/false mysql mysql mysql or useradd - r - g)
Modify the working directory permissions: chown -r mysql: mysql./; (switch to their installation directory)
Copy my. CNF to/etc/down;
Perform installation:./mysqld -- -- the initialize - user=mysql or - the initialize - insecure - user=mysql; (switch to the bin directory, which will generate a password) suggested that the former
Modify the directory permissions: chown -r root: a root./chown -r mysql: mysql data; (optional)
Copy the mysql service, enter the mysql directory: cp support - files/mysql. Server/etc/init. D/mysql; (if the mysql server is not an executable file, you need to use the chmod command assignment)
Powered up for registration service: the chkconfig -- add mysql to view the chkconfig -- the list;
Start the mysql service: service mysql start; (cannot execute 1. Create a log file and chown authorized; 2. Chmod 777/etc/init. D/mysql command assignment)
Link the socket file to/TMP/directory: ln -s/var/lib/mysql/mysql. The sock/TMP/; (the path/var/lib/mysql/mysql. The sock with my. The CNF should agree)
Add the mysql command shortcut access: ln -s/usr/local/mysql/bin/mysql/usr/bin/; (the path/usr/local/mysql/bin/mysql installation path)
Using the initial password mysql service: mysql - uroot - p;
Update the password: the alter user 'root' @ 'localhost' identified by 'root';
Flush privileges;
Open the remote connection permissions: update the user set the host='%' where the user='root'; (enter the user perform)
Flush privileges
If Windows client cannot open: normally open a Linux see if port 3306
Chown usage is used to change the user name and a directory or file of user groups,
Used to modify chmod usage a directory or file access permissions
CodePudding user response:
Thanks for sharing, you can write blog betterCodePudding user response:
The