linux下mysql的解除安裝、安裝全過程
解除安裝mysql
1、查詢以前是否裝有mysql
命令:rpm -qa|grep -i mysql
可以看到mysql的包:
mysql-libs-5.1.71-1.el6.x86_64
2、刪除mysql
刪除命令:rpm -e mysql-libs-5.1.71-1.el6.x86_64 --nodeps
解除安裝完成
安裝mysql
自動下載安裝
yum install mysql-server mysql mysql-devel
[[email protected] ~]$ sudo yum install mysql-server mysql mysql-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.neusoft.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.1.73-7.el6 will be installed
--> Processing Dependency: mysql-libs = 5.1.73-7.el6 for package: mysql-5.1.73-7.el6.x86_64
--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.73-7.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.73-7.el6.x86_64
--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql-5.1.73-7.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-5.1.73-7.el6.x86_64
---> Package mysql-devel.x86_64 0:5.1.73-7.el6 will be installed
--> Processing Dependency: openssl-devel for package: mysql-devel-5.1.73-7.el6.x86_64
---> Package mysql-server.x86_64 0:5.1.73-7.el6 will be installed
--> Processing Dependency: perl-DBI for package: mysql-server-5.1.73-7.el6.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.73-7.el6.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-server-5.1.73-7.el6.x86_64
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.73-7.el6 will be installed
---> Package openssl-devel.x86_64 0:1.0.1e-48.el6_8.3 will be installed
--> Processing Dependency: openssl = 1.0.1e-48.el6_8.3 for package: openssl-devel-1.0.1e-48.el6_8.3.x86_64
--> Processing Dependency: zlib-devel for package: openssl-devel-1.0.1e-48.el6_8.3.x86_64
--> Processing Dependency: krb5-devel for package: openssl-devel-1.0.1e-48.el6_8.3.x86_64
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Running transaction check
---> Package krb5-devel.x86_64 0:1.10.3-57.el6 will be installed
--> Processing Dependency: krb5-libs = 1.10.3-57.el6 for package: krb5-devel-1.10.3-57.el6.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.10.3-57.el6.x86_64
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.10.3-57.el6.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.10.3-57.el6.x86_64
---> Package openssl.x86_64 0:1.0.1e-15.el6 will be updated
---> Package openssl.x86_64 0:1.0.1e-48.el6_8.3 will be an update
---> Package zlib-devel.x86_64 0:1.2.3-29.el6 will be installed
--> Running transaction check
---> Package keyutils-libs-devel.x86_64 0:1.4-5.el6 will be installed
--> Processing Dependency: keyutils-libs = 1.4-5.el6 for package: keyutils-libs-devel-1.4-5.el6.x86_64
---> Package krb5-libs.x86_64 0:1.10.3-10.el6_4.6 will be updated
--> Processing Dependency: krb5-libs = 1.10.3-10.el6_4.6 for package: krb5-workstation-1.10.3-10.el6_4.6.x86_64
---> Package krb5-libs.x86_64 0:1.10.3-57.el6 will be an update
---> Package libcom_err-devel.x86_64 0:1.41.12-22.el6 will be installed
--> Processing Dependency: libcom_err = 1.41.12-22.el6 for package: libcom_err-devel-1.41.12-22.el6.x86_64
---> Package libselinux-devel.x86_64 0:2.0.94-7.el6 will be installed
--> Processing Dependency: libselinux = 2.0.94-7.el6 for package: libselinux-devel-2.0.94-7.el6.x86_64
--> Processing Dependency: libsepol-devel >= 2.0.32-1 for package: libselinux-devel-2.0.94-7.el6.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.94-7.el6.x86_64
--> Running transaction check
---> Package keyutils-libs.x86_64 0:1.4-4.el6 will be updated
--> Processing Dependency: keyutils-libs = 1.4-4.el6 for package: keyutils-1.4-4.el6.x86_64
---> Package keyutils-libs.x86_64 0:1.4-5.el6 will be an update
---> Package krb5-workstation.x86_64 0:1.10.3-10.el6_4.6 will be updated
---> Package krb5-workstation.x86_64 0:1.10.3-57.el6 will be an update
---> Package libcom_err.x86_64 0:1.41.12-18.el6 will be updated
--> Processing Dependency: libcom_err = 1.41.12-18.el6 for package: e2fsprogs-libs-1.41.12-18.el6.x86_64
--> Processing Dependency: libcom_err = 1.41.12-18.el6 for package: libss-1.41.12-18.el6.x86_64
--> Processing Dependency: libcom_err = 1.41.12-18.el6 for package: e2fsprogs-1.41.12-18.el6.x86_64
---> Package libcom_err.x86_64 0:1.41.12-22.el6 will be an update
---> Package libselinux.x86_64 0:2.0.94-5.3.el6_4.1 will be updated
--> Processing Dependency: libselinux = 2.0.94-5.3.el6_4.1 for package: libselinux-python-2.0.94-5.3.el6_4.1.x86_64
--> Processing Dependency: libselinux = 2.0.94-5.3.el6_4.1 for package: libselinux-utils-2.0.94-5.3.el6_4.1.x86_64
---> Package libselinux.x86_64 0:2.0.94-7.el6 will be an update
---> Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be installed
--> Running transaction check
---> Package e2fsprogs.x86_64 0:1.41.12-18.el6 will be updated
---> Package e2fsprogs.x86_64 0:1.41.12-22.el6 will be an update
---> Package e2fsprogs-libs.x86_64 0:1.41.12-18.el6 will be updated
---> Package e2fsprogs-libs.x86_64 0:1.41.12-22.el6 will be an update
---> Package keyutils.x86_64 0:1.4-4.el6 will be updated
---> Package keyutils.x86_64 0:1.4-5.el6 will be an update
---> Package libselinux-python.x86_64 0:2.0.94-5.3.el6_4.1 will be updated
---> Package libselinux-python.x86_64 0:2.0.94-7.el6 will be an update
---> Package libselinux-utils.x86_64 0:2.0.94-5.3.el6_4.1 will be updated
---> Package libselinux-utils.x86_64 0:2.0.94-7.el6 will be an update
---> Package libss.x86_64 0:1.41.12-18.el6 will be updated
---> Package libss.x86_64 0:1.41.12-22.el6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================
直到complete
切換到root許可權
service mysqld start
或者sudo操作下
[[email protected] ~]$ sudo service mysqld start
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h note1 password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
**對MySQL進行安裝**
/usr/bin/mysql_secure_installation
[[email protected] ~]$ /usr/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we’ll need the current
password for the root user. If you’ve just installed MySQL, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
… Success!
Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
… skipping.
By default, MySQL comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database…
… Success!
- Removing privileges on test database…
… Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
… Success!
Cleaning up…
All done! If you’ve completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
MySQL進行登入
[[email protected] ~]$ mysql -uroot -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, 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.
mysql>
MySQL就可以正確運行了
Linux狀況下也可以開啟桌面模式直接進行點選安裝更加快捷,包依賴問題都會自動解決,比命令要簡單的多。
相關推薦
Linux下MySQL 5.5、5.6和5.7的RPM、二進位制和原始碼安裝(下)
[[email protected] ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_rootlhr-Vol00 9.9
linux下mysql多實例安裝(轉)
ont 數據庫 fill 行修改 安裝部署 file 常見 soc -s 轉自:http://www.cnblogs.com/xuchenliang/p/6843990.html 1.MySQL多實例介紹 1.1.什麽是MySQL多實例 MySQL多實例就是在一臺機器上
Linux下mysql-5.7.20安裝
版本 symbol 問題 init temporary rar files sans AS 1 參考文檔 https://dev.mysql.com/doc/refman/5.7/en/source-installation.html https://dev.mysql.c
Windows 下mysql的下載、安裝、登入。
之前一直用sql server ,但是因為自己的電腦太老了,體量太大的sql server就不太合適了。這時候就想到了mysql 用了一下感覺很不錯 下載 下載地址 我用的是免安裝版,因為我的固態盤很小,所以把免安裝的放在行動硬碟上了。 下載是可以不用註冊帳號的 解
win10下MYSQL的下載、安裝以及配置超詳解教程
下載MYSQL 官網下載MYSQL5.7.21版本,連結地址https://www.mysql.com/downloads/。下載流程圖如下: 進入官網點選Community,下載社群版。 找到MYSQL Community Server,點選下方DOW
Linux下mysql的原始碼編譯安裝
1>【安裝依賴包】 yum -y install make gcc-c++ cmake bison-devel ncurses-devel bison perl perl-devel perl perl-devel 2>【解壓mys
win10下MYSQL的下載、安裝以及配置超詳解教程~~小白入
下載MYSQL 官網下載MYSQL5.7.21版本,連結地址https://www.mysql.com/downloads/。下載流程圖如下: 進入官網點選Community,下載社群版。 找到MYSQL Community Server,點選下方
linux下mysql 5.7.21 安裝
# tar -zxvf mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz 解壓 # mv mysql-5.7.21-linux-glibc2.12-x86_64 mysql 重新命名 # c
linux下mysql視覺化工具安裝
之前是一直用shell互動介面,但是最近頻繁地檢查資料庫中的資料感覺特別麻煩,便裝了一個視覺化工具。 安裝: $ sudo apt-get install mysql-workbench [sudo] ubuntu 的密碼: 正在讀取軟體包列表...
linux下mysql的解除安裝、安裝全過程及遇到"MySQL提示:The server quit without updating PID file問題的解決辦法"
1、查詢以前是否裝有mysql 命令:rpm -qa|grep -i mysql 可以看到mysql的兩個包: mysql-4.1.12-3.RHEL4.1 mysqlclient10-3.23.58-4.RHEL4.1 2、刪除mysql 刪除命令:rpm -e --nodeps 包名 (
linux下mysql的解除安裝、安裝全過程
解除安裝mysql 1、查詢以前是否裝有mysql 命令:rpm -qa|grep -i mysql 可以看到mysql的包: mysql-libs-5.1.71-1.el6.x86_64 2、刪除mysql 刪除命令:rpm -e mysql
一、Linux下MySQL安裝和解除安裝圖文教程詳解
處女作,第一次寫部落格,做了兩年的開發,工作之餘給自己找點有意義的事做,分享一下在開發過程當中的一些經驗總結,同時也當是自己的筆記吧,有時候有些東西長時間不用自己也記不住,好了,廢話就說
Linux 下徹底解除安裝Mysql
1、使用以下命令檢視當前安裝mysql情況,查詢以前是否裝有mysql 1 rpm -qa|
Linux下乾淨解除安裝mysql
1、使用以下命令檢視當前安裝mysql情況 rpm -qa|grep -i mysql 顯示之前安裝了: [[email protected] ~]$ rpm -qa|grep -i mysql perl-DBD-MySQL-4.013-3.el6.x86_64 My
Linux下徹底解除安裝MySQL
一、使用以下命令檢視當前安裝mysql情況,查詢以前是否裝有mysql rpm -qa|grep -i mysql 可以看到如下圖的所示: 顯示之前安裝了: MySQL-client-5.5.25a-1.rhel5 MySQL-server-5.5.25a-1.rhel5
linux下mysql的解除安裝,安裝,忘記密碼修改密碼,允許遠端連線的設定
一、linux下mysql的解除安裝 檢視已經安裝了的MySql的包 rpm -qa|grep -i mysql [[email protected] ~]# rpm -qa|grep -i mysql MySQL-c
Centos系統下解除安裝、安裝MySQL及使用者的建立、授權和使用(詳細。。。。)
由於經常使用linux系統,並且大資料環境搭建中經常會使用到mysql,不像windows系統下的安裝,今天有點空寫一篇,下面我給大家演示一遍。 主要有三部分內容: 1、MySQL的解除安裝 2、MySQL的安裝 3、MySQL使用者的授權和使用者建立、刪除 一、MySQL的解除安裝(如果是僅僅安裝
.Neter玩轉Linux系列之六:Linux下MySQL的安裝、配置、使用
基礎篇 實戰篇 一、Linux安裝MySQL (1)下載安裝包:https://dev.mysql.com/downloads/mysql/ (2)解壓並安裝 命令:tar zxvf 檔名 解壓完成之後,重名一下資料夾名字。 命令:mv 檔名1
9、Linux下mysql資料庫安裝與配置實操
1、安裝 sudo yum -y install mysql-server 2、 sudo vim /etc/my.cnf 將字符集設定成UTF-8 3、將mysql設定為隨系統啟動 sudo chkconfig mysqld on sudo chkco
linux下mysql的安裝路徑、執行路徑、執行守護mysqld
Linux下檢視mysql、apache是否安裝,並解除安裝。 指令 ps -ef|grep mysql 得出結果 1.root 17659 1 0 2011 ? 00:00:00 /bin/sh /usr/bin/mysqld_s