【阿里云环境配置】Centos 下Mysql的安装和配置

阿里云的云服务器下的Mysql安装,步骤持续完善中。


1、rpm -ivh 安装

2、安装完成后 ,提示信息如下:

//root 用户的随机密码存在何处
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

//在/root/.mysql_secret文件下可以找到密码
 You will find that password in '/root/.mysql_secret'.

//必须在首次连接的时候 修改root的密码 
You must change that password on your first connect,

//唯一的方式是通过SET_PASSWORD的方式修改
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:
//可以通过运行secure_install初始化
  /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

//默认的配置文件放在/usr/my.cnf
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

3、创建 /data/mysqldata文件夹

4、进行my.cnf配置(确保该文件在/etc下)

1)、在/data目录下新建目录mysqldata

2)、修改所属用户、组 chown -R mysql:mysql /data/mysqldata

3)、修改/etc/my.cnf

[client]
#password       = your_password
port            = 3306
socket          = /data/mysqldata/mysql.sock


# Here follows entries for some specific programs


# The MySQL server
[mysqld]
port            = 3306
datadir = /data/mysqldata
socket  = /data/mysqldata/mysql.sock
pid-file = /data/mysqldata/mysqld.pid


增加:

[mysql_safe]
log-error=/data/mysqldata/mysqld.log
pid-file =/data/mysqldata/mysqld.pid
socket  = /data/mysqldata/mysql.sock
datadir = /data/mysqldata

5、执行初始化 mysql_install_db

执行完后提示信息如下

//随系统启动 你必须将support-files/mysql.server拷贝到正确的位置
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 iZ28085fwakZ 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 mysql-test ; perl mysql-test-run.pl

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

WARNING: Found existing config file /usr/my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as /usr/my-new.cnf,
please compare it with your file and take the changes you need.

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

 6、mysql 的中文乱码 配置

7、mysql 表名的不区分大小写设置 :lower_case_table_names=1


Python网络爬虫与推荐算法新闻推荐平台:网络爬虫:通过Python实现新浪新闻的爬取,可爬取新闻页面上的标题、文本、图片、视频链接(保留排版) 推荐算法:权重衰减+标签推荐+区域推荐+热点推荐.zip项目工程资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松复刻,拿到资料包后可轻松复现出一样的项目,本人系统开发经验充足(全领域),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(如有)等。答辩评审平均分达到96分,放心下载使用!可轻松复现,设计报告也可借鉴此项目,该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的。 【提供帮助】:有任何使用问题欢迎随时与我联系,我会及时解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 下载后请首先打开README文件(如有),项目工程可直接复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值