CentOS/RHEL6+下以RPM方式安装MySQL5.5_MySQL
首先去http://dev.mysql.com/downloads/mysql/5.5.html#downloads站点下载:
分别下载以下三个文件(由于我的机器是32位,下面是32位版本的包,如果你的机器是64位的请下载64位版本):
MySQL-server-5.5.16-1.rhel5.i386.rpm
MySQL-client-5.5.16-1.rhel4.i386.rpm
MySQL-devel-5.5.16-1.rhel4.i386.rpm
使用wget命令使用断点传输的方式将这三个文件下载
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.16-1.rhel4.i386.rpm/from/http://mysql.spd.co.il/
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.16-1.rhel4.i386.rpm/from/http://mysql.spd.co.il/
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.16-1.rhel4.i386.rpm/from/http://mysql.spd.co.il/
下载完成后开始安装:
rpm -ivh MySQL-server-5.5.16-1.rhel4.i386.rpm MySQL-client-5.5.16-1.rhel4.i386.rpm MySQL-devel-5.5.16-1.rhel4.i386.rpm
提示安装完成后,输入mysql 看是否安装成功
mysql
如果出现如下错误信息:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
说明mysql服务还没有启动,输入service mysql start启动mysql服务
service mysql start
然后再输入mysql,若出现以下提示信息,说明成功。
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, 2011, 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.
首次安装时,默认密码为空,可以使用如下命令修改root密码,
mysqladmin -u root password mypassword
mypassword 为你设定的新密码
然后再次登录
mysql -u root –p
rpm包安装的MySQL是不会安装/etc/my.cnf文件的,解决方法,只需要复制/usr/share/mysql目录下的my-huge.cnf 文件到/etc目录,并改名为my.cnf即可
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
配置远程访问
处于安全考虑,Mysql默认是不允许远程访问的,可以使用下面开启远程访问
//赋予任何主机访问数据的权限
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION
//使修改生效
mysql>FLUSH PRIVILEGES
如果依然不能远程访问的话,那就很可能防火墙的原因了,可以在防火墙中开启3306端口或者干脆关掉防火墙。

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

AI Hentai Generator
Generate AI Hentai for free.

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

As a modern programming language, Go language plays an important role in development. The Go language provides some built-in time functions and structures to make time processing more convenient. In this article, we will introduce some commonly used time processing methods in the Go language. time.Now() We can use the time.Now() function to get the current time: now:=time.Now()fmt.Println(now) output: 2019-06-131

Chrome will automatically record the URLs that have been entered in the address bar, and will automatically "associate query content" in the future. But many times we don't need some URLs, how to delete them? The editor often encounters this problem. Addresses that have been entered before will be blocked in front of commonly used addresses, resulting in the need to select several times to enter the desired website. I have looked for how to delete it at least three times because... I forget it every time. In the address bar shortcuts of Chrome's official help Chrome keyboard shortcuts, the delete shortcut key is clarified: ▍Windows deletes the address bar association content. Press the down arrow key to highlight the corresponding content, and then press the Shift+Delete key ▍macOS deletes the address Bar association content click down

The xp system can be said to be a computer system that Microsoft released a long time ago. Currently, very few people are using it. The key is to use it on old computers. Many netizens want to upgrade the xp system to win7, but they don’t know how to upgrade the xp system to win7. .The actual operation steps will be demonstrated below. 1. Download and install the three-step software for beginners and open it. Select the win7 system and click to reinstall immediately. 2. Wait for the tool to automatically download the win7 system. 3. Reinstall the Windows system online immediately after downloading, please follow the prompts. 4. After the installation is completed, you can choose to restart immediately. 5. Enter the run menu bar and select the second item XiaoBaiPE-MSDNOnlineIns

The win7 system is Microsoft's traditional operating system and has many practical functions, such as the function of win7 system restore points. By setting a restore point in win7, you can restore the system to the restore point in win7 to achieve the purpose of system repair. How to set restore point in win? The following editor will teach you how to set a restore point in win7. How to set a restore point in win7 1. Find the desktop shortcut, right-click and select Properties. 2. After entering the property settings, select Advanced System Configuration. 3. Select the system maintenance option in the pop-up system properties box. 4. Click to create a restore point now for the controller with system protection turned on. 5. Add a description of the restore point, then click Create, wait patiently for a while, the restore point is successfully established, and then click Close. You can restore the system next time.

As the Go language becomes increasingly popular in the Internet industry, more and more developers are beginning to get involved in this language. In the Go language, type conversion is also one of the common programming operations. This article will introduce some common type conversion methods. Type assertion Type assertion is an operation that converts an interface type to another type. In Go language, type assertion can be made using the following syntax: value,ok:=interface{}.(type) where value represents the converted value, o

What are the signal processing methods in Go language? Go language is an efficient, concise programming language with native concurrency capabilities. It is widely used in network programming, distributed systems, cloud computing and other fields. In Go language, inter-process communication is implemented through pipes and signals. This article will introduce the use of signals and their processing methods in the Go language. Signals Overview A signal is a mechanism used by the operating system to send asynchronous events to processes. In Unix/Linux operating systems, signals are often used to notify processes of certain

To understand the five ways to obtain beans in Spring, you need specific code examples. Spring is an open source lightweight Java development framework. One of its core features is IoC (Inversion of Control, inversion of control). In Spring, Bean is the basic unit that constitutes an application, and there are many ways to obtain Beans. This article will introduce the five ways to obtain Beans in Spring and provide specific code examples. 1. Obtain through the configuration file

Do you know several ways of implicit type conversion? In programming, type conversion is a common operation that converts one data type to another data type. Type conversion can be explicit, that is, the data type to be converted is specified through code, or it can be implicit, that is, the data type conversion is automatically performed based on the context. Implicit type conversion is a very common feature in some programming languages, which can automatically complete type conversion without explicitly specifying type conversion. Next, we will introduce several common implicit type conversion methods and give the corresponding
