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

RedHat下MySQL 5.6 安装、维护

Jun 07, 2016 pm 05:05 PM
mysql安裝 redhat

准备环境: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

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

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

AI Clothes Remover

AI Clothes Remover

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

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

<🎜>:泡泡膠模擬器無窮大 - 如何獲取和使用皇家鑰匙
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系統,解釋
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Mandragora:巫婆樹的耳語 - 如何解鎖抓鉤
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

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

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1666
14
CakePHP 教程
1425
52
Laravel 教程
1324
25
PHP教程
1272
29
C# 教程
1251
24
redhat linux 免費嗎 redhat linux 免費嗎 Mar 25, 2023 am 10:43 AM

redhat linux是免費的,使用者是可以免費使用Redhat,但Redhat的服務是需要收費的;也就是說,使用者可以免費使用Redhat,但使用者需要支付一定的費用來取得Redhat公司的服務。

redhat怎麼安裝php和mysql redhat怎麼安裝php和mysql Feb 09, 2023 am 09:50 AM

redhat安裝php和mysql的方法:1、透過「yum install httpd」安裝Apache2並啟動;2、使用「yum install mysql mysql-server」安裝MySQL並啟動;3、透過「yum install php」安裝PHP,然後重新啟動Apache以使php生效即可。

Centos與Redhat:對比與關聯分析 Centos與Redhat:對比與關聯分析 Jan 04, 2024 pm 10:10 PM

CentOS的簡介  CentOS是CommunityENTerpriseOperatingSystem的簡稱,我們有很多人叫它社群企業作業系統,不管你怎麼叫它,它都是Linux作業系統的一個發行版本。  CentOS並不是全新的Linux發行版,倘若一說到RedHat這個大名,大家似乎都聽過。在RedHat家族中有企業版的產品,它是RedHatEnterpriseLinux(以下稱為RHEL),CentOS正是這個RHEL的複製版本。 RHEL是許多企業採用的Linux發行版本,需要向RedH

如何解決RedHat虛擬機器中無法輸入雙引號的問題? 如何解決RedHat虛擬機器中無法輸入雙引號的問題? Dec 30, 2023 pm 08:01 PM

今天不知道修改了什麼設置,我在vim裡面寫程式的時候,發現單引號和雙引號都打不出來。雙引號打出來的效果是¨¨,是導致程式出錯!造成這種問題的原因是鍵盤佈局與實際上不相符,要修改。單/雙引號打不出來的解決方法:(備註:如果你的桌面是英文版,請自己進行翻譯。)1、點擊系統-->選擇管理-->選擇鍵盤,將美國國際式改為美國英語式! 2、點選系統-->選擇首選項-->選擇鍵盤。檢查設定是否與下圖一致:然後重新開啟vim工具,問題應該就解決了!

mySQL下載完安裝不了 mySQL下載完安裝不了 Apr 08, 2025 am 11:24 AM

MySQL安裝失敗的原因主要有:1.權限問題,需以管理員身份運行或使用sudo命令;2.依賴項缺失,需安裝相關開發包;3.端口衝突,需關閉佔用3306端口的程序或修改配置文件;4.安裝包損壞,需重新下載並驗證完整性;5.環境變量配置錯誤,需根據操作系統正確配置環境變量。解決這些問題,仔細檢查每個步驟,就能順利安裝MySQL。

red hat linux有什麼特點 red hat linux有什麼特點 Mar 15, 2023 am 11:14 AM

red hat linux的特點:1、多用戶多任務作業系統,一台電腦可以同時有多個使用者同時使用,並且同時可以執行由多個使用者提交的多個任務;2、良好的相容性;3、強大的可移植性,無論是掌上電腦,個人計算機,小型計算機,還是中型計算機,甚至是大型計算機都可以運行Linux;4、高度的穩定性、可靠性與安全性;5、開放性與低費用。

mysql安裝後怎麼使用 mysql安裝後怎麼使用 Apr 08, 2025 am 11:48 AM

文章介紹了MySQL數據庫的上手操作。首先,需安裝MySQL客戶端,如MySQLWorkbench或命令行客戶端。 1.使用mysql-uroot-p命令連接服務器,並使用root賬戶密碼登錄;2.使用CREATEDATABASE創建數據庫,USE選擇數據庫;3.使用CREATETABLE創建表,定義字段及數據類型;4.使用INSERTINTO插入數據,SELECT查詢數據,UPDATE更新數據,DELETE刪除數據。熟練掌握這些步驟,並學習處理常見問題和優化數據庫性能,才能高效使用MySQL。

MySQL安裝時提示缺少依賴項如何解決 MySQL安裝時提示缺少依賴項如何解決 Apr 08, 2025 pm 12:00 PM

MySQL安裝失敗通常因缺少依賴項導致。解決方法:1.使用系統包管理器(如Linux的apt、yum或dnf,Windows的VisualC Redistributable)安裝缺失的依賴庫,例如sudoaptinstalllibmysqlclient-dev;2.仔細檢查錯誤信息,逐一解決複雜的依賴關係;3.確保包管理器源配置正確,能訪問網絡;4.對於Windows,下載安裝必要的運行庫。養成閱讀官方文檔和善用搜索引擎的習慣,能有效解決問題。

See all articles