网站建设山东,网站建设公司做网站需要注意什么,邯郸哪里做网站好,海外seo推广公司安装mysql的Linux机器是Centos6的系统#xff0c;机器名字叫combanc05mysql我采用的是5.5版本。安装过程中需要解决新旧版的冲突问题#xff0c;并允许mysql被远程访问。以便其作为hive的元数据仓库顺利运行。下载到mysql在linux中安装mysql#xff0c;首先可以到官网去找Li…安装mysql的Linux机器是Centos6的系统机器名字叫combanc05mysql我采用的是5.5版本。安装过程中需要解决新旧版的冲突问题并允许mysql被远程访问。以便其作为hive的元数据仓库顺利运行。下载到mysql在linux中安装mysql首先可以到官网去找Linux(Centos6.4)对应的mysql版本也就是Red Hat对应的版本。下载之后上传到linux文件系统中。解决新旧版本的冲突只安装server就可以但是安装client配置起来很方便。#用 rpm 来安装命令rpm -ivh MySQL-server-5.5.31-2.el6.i686i 安装 instancev 显示详情h 显示进度#用 rpm来显示查询已经安装的旧版本命令rpm -qa | grep mysql命令rpm -qa | grep MySQLqa 将所有的rpm包都显示出来。aall管道过滤所有的mysql#用rpm卸载已经安装的旧版本。命令rpm -e mysql-libs-5.1.66-2.el6_3.i686eerase 擦除。error: Failed dependencies:libmysqlclient.so.16 is needed by (installed) postfix-2:2.6.6-2.2.el6_1.i686libmysqlclient.so.16(libmysqlclient_16) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.i686mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.i686报错了说明有别的包依赖它。#使用暴力的方式强制删除命令 rpm -e mysql-libs-5.1.66-2.el6_3.i686 --nodeps#重新安装一下mysql命令 rpm -ivh MySQL-server-5.5.31-2.el6.i686将安装好的mysql初始化---------------------安装成功之后会有这么一段。----------------------------------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 combanc04 password new-passwordAlternatively you can run:/usr/bin/mysql_secure_installation 你可以用这个对mysql进行初始化which will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.See the manual for more instructions.-----------------------------------------------------------------------------------#为安装配置方便我们要将client也安装上去命令rpm -ivh MySQL-client-5.5.31-2.el6.i686#提示用这条命名对mysql进行初始化/usr/bin/mysql_secure_installation#命令/usr/bin/mysql_secure_installation初始化之前我们需要先启动mysql server---------------------初始化的时候会有如下的报错-----------------------------------NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQLSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MySQL to secure it, well need the currentpassword for the root user. If youve just installed MySQL, andyou havent 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):ERROR 2002 (HY000):Cant connect to local MySQL server through socket /var/lib/mysql/mysql.sock(2)Enter current password for root (enter for none):Aborting!----------------------------------------------------------------------------------------#为了解决这一错误我们打开mysql安装目录/usr/share/mysql下的mysql.server文件命令vim /usr/share/mysql/mysql.server里面有这样一段话。# If you install MySQL on some other places than /usr, then you# have to do one of the following things for this script to work:##- Run this script from within the MySQL installation directory 先这么办这个是好用的。# - Create a /etc/my.cnf file with the following information:# [mysqld]# basedir# - Add the above to any other configuration file (for example ~/.my.ini)# and copy my_print_defaults to /usr/bin# - Add the path to the mysql-installation-directory to the basedir variable# below.## If you want to affect other MySQL variables, you should make your changes# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.# If you change base dir, you must also change datadir. These may get# overwritten by settings in the MySQL configuration files.basedirdatadir -------------------------------------------------------------------------------------------------我们跑到mysql的安装目录里面去启动mysql#跑到mysql的安装目录命令 cd /usr/share/mysql#在/usr/share/mysql下查看mysql是否启动命令service mysql status#在/usr/share/mysql文件夹下启动mysql命令service mysql start对mysql进行初始化命令/usr/bin/mysql_secure_installation要设置root密码为hadoop要删除匿名用户记得要允许用户远程连接。#在mysql中运行一个授权语句授权root用户可以在任何主机上访问mysql用密码hadoop命令GRANT ALL PRIVILEGES ON *.* TO root% IDENTIFIED BY hadoop WITH GRANT OPTION;如果root用户可以在combanc03上访问则改成rootcombanc03就可以了。如果你仅想操作hive库下面的所有表则 *.*变成hive.* #在mysql中运行一个授权语句授权root用户可以在任何主机上访问mysql用密码hadoop命令GRANT ALL PRIVILEGES ON *.* TO root% IDENTIFIED BY hadoop WITH GRANT OPTION;如果root用户可以在combanc03上访问则改成rootcombanc03就可以了。如果你仅想操作hive库下面的所有表则 *.*变成hive.*