yum -y install mariadb mariadb-server
$: systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
Enter current password for root: <–初次运行直接回车
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码
Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车
use mysql;
针对ip>>>> create user ‘root’@’192.168.10.10’ identified by ‘password’;
全部 >>>>create user ‘root’@’%’ identified by ‘password’;
给用户最大权限>>>> grant all privileges on . to ‘root’@’允许远程访问数据库的IP地址’ identified by ‘password’;
给部分权限(test 数据库) >>>>grant all privileges on test.* to ‘root’@’%’ identified by ‘password’ with grant option;
flush privileges;
ow global variables like 'port';
接下来就可以在远程的数据库可视化工具中直接访问该服务器中的mysql了。
在数据库工具中输入数据库IP地址、端口,用户名root,密码就可以连接了。
在centos中,系统默认只提供python2.7的版本,但是项目我们使用的python3.7的版本。所有我们自己安装python3
yum -y groupinstall “Development tools”
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
tar -xvJf Python-3.7.3.tar.xz
cd Python-3.7.3
./configure --prefix=/usr/local/python3
make && make install
在这里由于一般位于3.7以上版本编译安装时出错 是因为缺少依赖包libffi-devel 在安装3.7以上版本时,需要一个新的libffi-devel包做依赖 解决方法:
yum -y install libffi-devel tk-devel
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
由于centerOS自带的pipy版本比较低,为了预防下面使用pip3安装所需要的包,建议在这一步骤就使用升级命令讲pip更新到最新版本。 更新命令:
pip3 install --upgrade pip
yum install python-virtualenv
virtualenv --no-site-packages env
cd env
source bin/activate
下班了,未完待续