搜尋
首頁資料庫mysql教程RedHat下MySQL 5.6 安装、维护

准备环境:RedHat 5系统、MySQL 5.6 rpm包首先 上传mysql至服务器1、 解压缩MySql[root@www.linuxidc.com]# tar -xvf MySQL-5.6.

准备环境:

RedHat 5系统、MySQL 5.6 rpm包

首先 上传mysql至服务器

1、 解压缩MySql

[root@]# tar -xvf MySQL-5.6.2_m5-1.rhel5.i386.tar

MySQL-client-5.6.2_m5-1.rhel5.i386.rpm

MySQL-devel-5.6.2_m5-1.rhel5.i386.rpm

MySQL-embedded-5.6.2_m5-1.rhel5.i386.rpm

MySQL-server-5.6.2_m5-1.rhel5.i386.rpm

MySQL-shared-5.6.2_m5-1.rhel5.i386.rpm

MySQL-test-5.6.2_m5-1.rhel5.i386.rpm

2、 安装MySQL-server包

[root@]# rpm -ivh MySQL-server-5.6.2_m5-1.rhel5.i386.rpm

error:Failed dependencies:

     MySQL conflicts with mysql-5.0.45-7.el5.i386

         MySQL-serverconflicts with mysql-server-5.0.45-7.el5.i386

(安装失败,,由于系统先前安装有mysql,把它卸载掉!再安装)

        [root@]# rpm -e mysql-5.0.45-7.el5.i386 --nodeps

[root@]# rpm -e mysql-server-5.0.45-7.el5.i386 –nodeps

[root@]# rpm -ivh MySQL-server-5.6.2_m5-1.rhel5.i386.rpm

Preparing...        ########################################### [100%]

   1:MySQL-server  ###########################################[100%]

[root@]# rpm -ivh MySQL-client-5.6.2_m5-1.rhel5.i386.rpm

Preparing...          ########################################### [100%]

   1:MySQL-client    ########################################### [100%]

 

3、 启动mysql并设置登录密码

[root@]# /etc/init.d/mysql start

StartingMySQL......[  OK  ]

[root@shiyue5 u01]# mysqladmin -u rootpassword "123456"

4、 登录mysql并创建数据库

[root@shiyue5~]# mysql -u root -p

Enterpassword:

Welcometo the MySQL monitor.  Commands end with; or \g.

YourMySQL connection id is 5

Serverversion: 5.6.2-m5 MySQL Community Server (GPL)

 

Copyright(c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

 

Oracleis 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.

 

mysql>create database shiyue;

QueryOK, 1 row affected (0.01 sec)

5、 配置客户端连接

mysql>use mysql;

Readingtable information for completion of table and column names

Youcan turn off this feature to get a quicker startup with -A

 

Database changed

mysql>grant all on *.* to root@"%" identified by "123456";

QueryOK, 0 rows affected (0.00 sec)

 


通过对1042问题代码的查询,得出编辑/etc/my.cnf文件,在[mysqld]内添加一行skip-name-resolve

在/etc/目录下如没有my.cnf配置文件,则请到/usr/share/mysql/下找到*.cnf文件,拷贝其中的一个到/etc/并改名为my.cnf

[root@shiyue5~]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

[root@shiyue5~]# vi /etc/my.cnf

 

#Example MySQL config file for medium systems.

#

# Thisis for a system with little memory (32M - 64M) where MySQL plays

# animportant part, or systems up to 128M where MySQL is used together with

#other programs (such as a web server)

#

#MySQL programs look for option files in a set of

#locations which depend on the deployment platform.

# Youcan copy this option file to one of those

#locations. For information about these locations, see:

#

#

# Inthis file, you can use all long options that a program supports.

# Ifyou want to know which options a program supports, run the program

# withthe "--help" option.

 

# Thefollowing options will be passed to all MySQL clients

[client]

#password       = your_password

port            = 3306

socket          = /var/lib/mysql/mysql.sock

 

# Herefollows entries for some specific programs

 

# TheMySQL server

[mysqld]

port            = 3306

socket          = /var/lib/mysql/mysql.sock

skip-external-locking

key_buffer_size= 16M

max_allowed_packet= 1M

table_open_cache= 64

sort_buffer_size= 512K

net_buffer_length= 8K

read_buffer_size= 256K

read_rnd_buffer_size= 512K

myisam_sort_buffer_size= 8M

skip-name-resolve

 

#Don't listen on a TCP/IP port at all. This can be a security enhancement,

# ifall processes that need to connect to mysqld run on the same host.

# Allinteraction with mysqld must be made via Unix sockets or named pipes.

"/etc/my.cnf"145L, 4700C written

linux

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
減少在Docker中使用MySQL內存的使用減少在Docker中使用MySQL內存的使用Mar 04, 2025 pm 03:52 PM

本文探討了Docker中的優化MySQL內存使用量。 它討論了監視技術(Docker統計,性能架構,外部工具)和配置策略。 其中包括Docker內存限制,交換和cgroups

mysql無法打開共享庫怎麼解決mysql無法打開共享庫怎麼解決Mar 04, 2025 pm 04:01 PM

本文介紹了MySQL的“無法打開共享庫”錯誤。 該問題源於MySQL無法找到必要的共享庫(.SO/.DLL文件)。解決方案涉及通過系統軟件包M驗證庫安裝

如何使用Alter Table語句在MySQL中更改表?如何使用Alter Table語句在MySQL中更改表?Mar 19, 2025 pm 03:51 PM

本文討論了使用MySQL的Alter Table語句修改表,包括添加/刪除列,重命名表/列以及更改列數據類型。

在 Linux 中運行 MySQl(有/沒有帶有 phpmyadmin 的 podman 容器)在 Linux 中運行 MySQl(有/沒有帶有 phpmyadmin 的 podman 容器)Mar 04, 2025 pm 03:54 PM

本文比較使用/不使用PhpMyAdmin的Podman容器直接在Linux上安裝MySQL。 它詳細介紹了每種方法的安裝步驟,強調了Podman在孤立,可移植性和可重複性方面的優勢,還

什麼是 SQLite?全面概述什麼是 SQLite?全面概述Mar 04, 2025 pm 03:55 PM

本文提供了SQLite的全面概述,SQLite是一個獨立的,無服務器的關係數據庫。 它詳細介紹了SQLite的優勢(簡單,可移植性,易用性)和缺點(並發限制,可伸縮性挑戰)。 c

在MacOS上運行多個MySQL版本:逐步指南在MacOS上運行多個MySQL版本:逐步指南Mar 04, 2025 pm 03:49 PM

本指南展示了使用自製在MacOS上安裝和管理多個MySQL版本。 它強調使用自製裝置隔離安裝,以防止衝突。 本文詳細詳細介紹了安裝,起始/停止服務和最佳PRA

如何為MySQL連接配置SSL/TLS加密?如何為MySQL連接配置SSL/TLS加密?Mar 18, 2025 pm 12:01 PM

文章討論了為MySQL配置SSL/TLS加密,包括證書生成和驗證。主要問題是使用自簽名證書的安全含義。[角色計數:159]

哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什麼?哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什麼?Mar 21, 2025 pm 06:28 PM

文章討論了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比較了它們對初學者和高級用戶的功能和適合性。[159個字符]

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前By尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前By尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

VSCode Windows 64位元 下載

VSCode Windows 64位元 下載

微軟推出的免費、功能強大的一款IDE編輯器

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

EditPlus 中文破解版

EditPlus 中文破解版

體積小,語法高亮,不支援程式碼提示功能

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境