Linux如何设置mysql数据库
发布时间:2021-12-29 04:13:54 所属栏目:编程 来源:互联网
导读:这篇文章主要为大家展示了Linux如何安装mysql数据库,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下Linux如何安装mysql数据库这篇文章吧。 [root@szq enterprise]# rpm -ivh MySQL-client-advanced-5.6.24-1.el6.
这篇文章主要为大家展示了“Linux如何安装mysql数据库”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux如何安装mysql数据库”这篇文章吧。 [root@szq enterprise]# rpm -ivh MySQL-client-advanced-5.6.24-1.el6.x86_64.rpm Preparing... ########################################### [100%] package MySQL-client-advanced-5.6.24-1.el6.x86_64 is already installed [root@szq enterprise]# rpm -ivh MySQL-shared-advanced-5.6.24-1.el6.x86_64.rpm Preparing... ########################################### [100%] 1:MySQL-shared-advanced ########################################### [100%] [root@szq enterprise]# rpm -ivh MySQL-devel-advanced-5.6.24-1.el6.x86_64.rpm Preparing... ########################################### [100%] 1:MySQL-devel-advanced ########################################### [100%] [root@szq enterprise]# rpm -ivh MySQL-server-advanced-5.6.24-1.el6.x86_64.rpm Preparing... ########################################### [100%] file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64 file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64 file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64 file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64 file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64 file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64 file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64 这里报错,一大堆,其实就是因为本系统之前已经有了mysql-libs 这个包,可以查看验证: [root@szq enterprise]# rpm -qa|grep mysql-libs mysql-libs-5.1.52-1.el6_0.1.x86_64 A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER ! You will find that password in '/root/.mysql_secret'. You must change that password on your first connect, no other statement but 'SET PASSWORD' will be accepted. See the manual for the semantics of the 'password expired' flag. Also, the account for the anonymous user has been removed. In addition, you can run: /usr/bin/mysql_secure_installation which will also give you the option of removing the test database. This is strongly recommended for production servers. See the manual for more instructions. Please report any problems at http://bugs.mysql.com/ The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com New default config file was created as /usr/my.cnf and will be used by default by the server when you start it. You may edit this file to change server settings [root@szq enterprise]# cat /root/.mysql_secret # The random password set for the root user at Mon Mar 28 14:58:58 2016 (local time): RK_wpPXYQ7MTjbZy [root@szq enterprise]# /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. You already have a root password set, so you can safely answer 'n'. Change the 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! All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! Cleaning up... [root@szq enterprise]# mysql -pmysql123 (小写的p后面直接跟密码,不能有空格,若有空格,则被认为是db name。其他参数无此要求,可有空格也可无空格。) Warning: Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 16 Server version: 5.6.24-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial) Copyright (c) 2000, 2015, 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> 以上是“Linux如何安装mysql数据库”这篇文章的所有内容,感谢各位的阅读! (编辑:广西网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐