VMware下Linux的MySQL安装和升级
Linux下mysql的安装方法有三种1、yum/rpm 2、源码安装 3、二进制安装第一种安装方式就不说了 这里所说的升级主要是二进制安装的
Linux下mysql的安装方法有三种1、yum/rpm 2、源码安装 3、二进制安装
第一种安装方式就不说了 这里所说的升级主要是二进制安装的升级方式,十分的简单!
操作平台CentOS 5.5
免费下载地址在
用户名与密码都是
一、yum/rpm 方式的安装
首先寻找可以安装的包(镜像站可以提供的,这里采用的是上海交通大学的linux镜像站)
[root@localhost ~]# yum search mysql(通过这个命令可以找出需要安装的几个包,,mysql.i386 mysql-bench.i386,mysql-devel.i386,mysql-server.i386 )
[root@localhost ~]# yum -y install mysql.i386 mysql-bench.i386 mysql-devel.i386 mysql-server.i386 (这条命令下去就可以很开心点的安装好了)
二、二进制安装
[root@localhost ~]# tar zxvf mysql-standard-5.0.16-linux-i686.tar.gz (解压一下)
[root@localhost ~]# mv mysql-standard-5.0.16-linux-i686/ /usr/local/
[root@localhost ~]# cd /usr/local/
[root@localhost local]# ln -s mysql-standard-5.0.16-linux-i686/ mysql
[root@localhost local]# mkdir /opt/mysql
[root@localhost local]# chown mysql.mysql /opt/mysql/
[root@localhost mysql]# cp -fp support-files/my-medium.cnf.sh my3307.cnf
[root@localhost mysql]# vi my3307.cnf (修改以下的语句)
[client]
#password = your_password
port = 3307
socket = /tmp/mysql3307.sock
[mysqld]
port = 3307
socket = /tmp/mysql3307.sock
basedir=/usr/local/mysql
datadir=/opt/mysql
[root@localhost mysql]# ./scripts/mysql_install_db --defaults-file=./my3307.cnf --user=mysql (数据库的初始化)
[root@localhost mysql]# chown -R root.mysql .
[root@localhost bin]# ./mysqld_safe --defaults-file=../my3307.cnf --user=mysql &(启动数据库)
[root@localhost bin]# netstat -tulnp|grep 3307(查看已经启动成功了)
tcp 0 0 0.0.0.0:3307 0.0.0.0:* LISTEN 20511/mysqld
[root@localhost bin]# ./mysql -uroot -S /tmp/mysql3307.sock (数据库的连接)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The main reasons for MySQL installation failure are: 1. Permission issues, you need to run as an administrator or use the sudo command; 2. Dependencies are missing, and you need to install relevant development packages; 3. Port conflicts, you need to close the program that occupies port 3306 or modify the configuration file; 4. The installation package is corrupt, you need to download and verify the integrity; 5. The environment variable is incorrectly configured, and the environment variables must be correctly configured according to the operating system. Solve these problems and carefully check each step to successfully install MySQL.

The article introduces the operation of MySQL database. First, you need to install a MySQL client, such as MySQLWorkbench or command line client. 1. Use the mysql-uroot-p command to connect to the server and log in with the root account password; 2. Use CREATEDATABASE to create a database, and USE select a database; 3. Use CREATETABLE to create a table, define fields and data types; 4. Use INSERTINTO to insert data, query data, update data by UPDATE, and delete data by DELETE. Only by mastering these steps, learning to deal with common problems and optimizing database performance can you use MySQL efficiently.

MySQL installation failure is usually caused by the lack of dependencies. Solution: 1. Use system package manager (such as Linux apt, yum or dnf, Windows VisualC Redistributable) to install the missing dependency libraries, such as sudoaptinstalllibmysqlclient-dev; 2. Carefully check the error information and solve complex dependencies one by one; 3. Ensure that the package manager source is configured correctly and can access the network; 4. For Windows, download and install the necessary runtime libraries. Developing the habit of reading official documents and making good use of search engines can effectively solve problems.

Common reasons and solutions for MySQL installation failure: 1. Incorrect username or password, or the MySQL service is not started, you need to check the username and password and start the service; 2. Port conflicts, you need to change the MySQL listening port or close the program that occupies port 3306; 3. The dependency library is missing, you need to use the system package manager to install the necessary dependency library; 4. Insufficient permissions, you need to use sudo or administrator rights to run the installer; 5. Incorrect configuration file, you need to check the my.cnf configuration file to ensure the configuration is correct. Only by working steadily and carefully checking can MySQL be installed smoothly.

How to correct the error in MySQL database file path setting: 1. Stop MySQL service; 2. Strongly recommend backing up data; 3. Modify the datadir parameter in the configuration file to the correct path, and ensure that MySQL users have read and write permissions; 4. It is recommended to create a new data directory; 5. Start MySQL service; 6. Verify whether the database is running normally and data integrity. Be sure to operate with caution to avoid data loss.

The solution to the MySQL repeated installation prompt is to completely remove the remaining traces: 1. Use the control panel to uninstall relevant programs; 2. Manually delete files and registry entries in the MySQL installation directory (backup before operation); 3. Stop and delete MySQL-related services in the system service; 4. Restart the computer. In addition, it is recommended to use professional uninstall tools, check environment variables, select official installation packages and clear installation paths to avoid this problem again.

MySQL installation failure is usually caused by the following reasons: 1. Permission problems, requiring administrator or root permissions; 2. 3306 port conflicts, ports need to be checked and released or configuration modified; 3. The dependency library is missing, and it needs to be installed using the package manager; 4. The installation package is damaged, and it needs to be downloaded and verified; 5. The environment variable problem, the installation path needs to be configured correctly. The solution needs to be checked based on specific error information and operating system. For example, when installing source code under Linux, you can check the library file path and compilation options to ensure the installation process is completed smoothly.

Solutions to MySQL installation failure: 1. Confirm that the downloaded installation package is correct and complete. It is recommended to download and verify it from the official website; 2. Check the system environment to ensure sufficient memory and disk space, and run the installer with administrator privileges; 3. Temporarily close the firewall and antivirus software, restore and set exception rules after the installation is completed; 4. Check the installation log file, analyze the error information, and find the root cause of the problem; 5. Finally restart the system. Through the above steps, you can effectively troubleshoot and resolve MySQL installation problems.
