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