MAC 安装mysql及遇到问题

1。安装步骤参照

https://www.cnblogs.com/bookwed/p/5896619.html

 

2.出现问题

1)缺data-dumper

A 现象

[root@localhost mysql]#./scripts/mysql_install_db --user=mysql --datadir=/usr/app/mysql/data/mysql

FATAL ERROR: please install thefollowing Perl modules before executing ./scripts/mysql_install_db:

Data::Dumper

B 处理方法

yum -y install autoconf

2)安装文件为32位,系统为64

执行./scripts/mysql_install_db--user=mysql --datadir=/usr/app/mysql/data/mysql --basedir=/usr/app/mysql

sh:/usr/app/mysql/bin/my_print_defaults: /lib/ld-linux.so.2: bad ELF interpreter:没有那个文件或目录

FATAL ERROR: Neither host'localhost.localdomain' nor 'localhost' could be looked up with

/usr/app/mysql/bin/resolveip

Please configure the 'hostname'command to return a correct

hostname.

If you want to solve this at alater stage, restart this script

with the --force option



网上查资料表明是64位系统安装32位软件会报这个错误需要安装glbc-i686,后来意识到为安装文件有问题重新下载安装包

3.安装成功提示

 

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for yoursystem

 

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL rootUSER !

To do so, start the server, then issue the followingcommands:

 

  ./bin/mysqladmin -u root password'new-password'

  ./bin/mysqladmin -u root -hlocalhost.localdomain password 'new-password'

 

Alternatively you can run:

 

  ./bin/mysql_secure_installation

 

which will also give you the option of removing thetest

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 . ; ./bin/mysqld_safe &

 

You can test the MySQL daemon with mysql-test-run.pl

 

  cd mysql-test ; perl mysql-test-run.pl

 

Please report any problems at http://bugs.mysql.com/

 

The latest information about MySQL is available on theweb at

 

  http://www.mysql.com

 

Support MySQL by buying support/licenses at http://shop.mysql.com

 

New default config file was created as ./my.cnf and

will be used by default by the server when you startit.

You may edit this file to change server settings

 

WARNING: Default config file /etc/my.cnf exists on thesystem

This file will be read by default by the MySQL server

If you do not want to use this, either remove it, oruse the

--defaults-file argument to mysqld_safe when startingthe server

 

4.修改root密码

 

方法1: 用SET PASSWORD命令 

首先登录MySQL。 

格式:mysql>set password for 用户名@localhost = password('新密码'); 

例子:mysql>set password for root@localhost = password('123'); 

 

方法2:用mysqladmin 

格式:mysqladmin-u用户名 -p旧密码 password 新密码 

例子:mysqladmin-uroot -p123456 password 123 

 

方法3:用UPDATE直接编辑user表 

首先登录MySQL。 

mysql>use mysql; 

mysql>update user set password=password('123') where user='root' andhost='localhost'; 

mysql>flush privileges; 



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值