Mysql install on deepin linux
config deepin apt source
sudo vi /etc/apt/sources.list
edit the content
#1. 统信UOS系统官方默认源sources.list文件
## Generated by deepin-installer
deb [by-hash=force] https://professional-packages.chinauos.com/desktop-professional eagle main contrib non-free
#deb-src [by-hash=force] https://professional-packages.chinauos.com/desktop-professional eagle main contrib non-free
install apache2 php mysql
sudo apt install apache2 php default-mysql-server default-mysql-client
test apache2
browser http://127.0.0.1/
test mysql
- check version
system@system-PC:~/Downloads$ mysql --version
mysql Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnu (aarch64) using readline 5.2
- root login
使用 mysql -uroot -p直接登录 [空密码] mysql
mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY "654321";
mysql> GRANT ALL PRIVILEGES ON *.* TO root@127.0.0.1 IDENTIFIED BY "654321";
他们的区别 (通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP)
- update root password
mysql> update mysql.user set authentication_string=password('xxxxx') where user='root' and Host = 'localhost';
Query OK, 1 row affected, 1 warning (0.00 sec)
- create user
创建一个用户 供开发使用 用户名:test 密码:test 可以本地和远程访问‘%’
create user 'test'@'%' identified by '123456';
赋予权限 权限可以分为多种 这里赋予所有权限all privileges .
grant all privileges on . to 'test' @'%' identified by '123456';
flush privileges;
exit;
test php
- edit test page
system@system-PC:/var/www/html$ sudo vi phpinfo.php