发表于: 2017-10-03 00:01:07
2 845
今天完成的事情:
1 买了一台阿里云的云服务器ECS,并成功连接
(1)通过管理控制台远程连接:


(2)xshell连接:图方便直接写入用户名和密码。
2 配置JDK,Mysql
(1)JDK
(2)Mysql
确认没有安装mysql:
yum list installed|grep mysql
下载mysql二进制包:
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
确认没有创建过mysql的用户和组:
userdel mysql
groupdel mysql
创建文件夹用于安装:
mkdir /home/mysql
mkdir /home/mysql/data
创建组合用户:
groupadd mysql
useradd -g mysql -d /home/mysql mysql
(useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
貌似不用理会)
解压缩:
tar -xzvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
转移到home/mysql下:
cd mysql-5.7.13-linux-glibc2.5-x86_64
mv * /home/mysql
初始化:
cd /home/mysql
./bin/mysqld --user=mysql --basedir=/home/mysql --datadir=/home/mysql/data --initialize
(!记录root@localhost:后面的随机码。)
检测能否启动:
./support-files/mysql.server start
成功:
Starting MySQL.Logging to '/home/mysql/data/iZ0jceyu4vvwu6Z.err'. [ OK ]
进入数据库:
mysql -u root -p
Enter password:
修改密码!
set password = password('XXXXX');
明天计划的事情:
1继续部署
遇到的问题:
1 Linux啊,命令行模式的操作很不顺手。多练,多记。
2 由于没有基础,Mysql在Lunix的配置好神奇。。有很多坑。
收获
1 使用window系统的云服务器在官网下载JDK时,一直没有跳出下载链接(。。。is create)
通过设置远程桌面-本地资源-详细信息,勾选本地盘,上传JDK和Mysql。然而并没有多大用处。
后来了解到需要使用Linux系统来进行数据库的部署,更换服务器的系统。
2 通过web版的管理控制台登录时,password输入不显示!有点懵。尝试输入正确密码后回车,居然进去了。此时正好回想到某师兄曾经在群里说过此坑。
3通过winscp小程序进行window和lunix之间的文件传输。 用户名:root。。。。
4 一些坑
./support-files/mysql.server start
cd: /usr/local/mysql: No such file or directory
Starting MySQLCouldn't find MySQL server (/usr/local/mysql/[FAILED]ld_safe)
修改mysql.server中的basedir和datadir
vim support-files/mysql.server
i键开始修改:
basedir=/home/mysql
datadir=/home/mysql/data
esc退出写入操作,shift+“:”唤出命令行,wq!保存退出
./support-files/mysql.server start
Starting MySQL.2017-10-02T15:18:47.626817Z mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log', however file don't exists. Create writable for user 'mysql'.
The server quit without updating PID file (/var/lib/mysql/i[FAILED]vvwu6Z.pid).
vim /etc/my.cnf
log-error=/var/log/mysql/mysql.log
pid-file=/var/run/mysql/mysql.pid
./support-files/mysql.server start
Starting MySQL.Logging to '/var/log/mysql/mysql.log'.
2017-10-02T15:53:01.087872Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists.
The server quit without updating PID file (/var/lib/mysql/i[FAILED]vvwu6Z.pid).
重命名/etc/my.cnf
附上my.cnf:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mysql/mysql.log
pid-file=/var/run/mysql/mysql.pid
skip-grant-tables
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
评论