# Rpm-qa | grep-I mysql view installed mysql versions
Delete an existing mysql version
To install the server and client, go to the Oracle official website to download:
# Rpm-ivh MySQL-server-5.5.28-1.linux2.6.i386.rpm
# Rpm-ivh MySQL-client-5.5.28-1.linux2.6.i386.rpm
After installation, the following information appears, prompting you not to forget the password and other information of the root user.
Check whether mysql services are started # netstat-nat
If the port number is 3306, the service is started. The default port is 3306. If the port number is not started, start service # service mysql start to start the mysql service.
Then enter mysql. If the following message is displayed, it indicates that the operation is successful.
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 1
Server version: 5.5.16 MySQL Community Server (GPL)
Copyright (c) 2000,201 1, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
After entering the mysql database: mysql> use mysql;
Check the root user and select user and password form user;
Change password update user set password = password ('newpassword') where user = 'root' and host = 'root' or host = 'localhost ';
So far, mysql has been installed successfully.
However, remote access still does not work. There are two other places: Database setting and firewall. Generally, the database can be connected directly. I only do not have the ROOT permission. If I cannot connect to the server, the firewall will block me.
The database's MYSQL table controls the accessible permissions, so we need to change it so that we have the ROOT permission.