Ubuntu MySQL安裝

step1:安裝css

  sudo apt-get install mysql-serverjava

  sudo apt isntall mysql-clientmysql

  sudo apt install libmysqlclient-devsql

檢查是否安裝成功:數據庫

  sudo netstat -tap | grep mysqlide

step2:重啓spa

  sudo service mysql restartrest

step3:登陸code

  mysql -u root - pserver

step4:受權

  grant all on *.* to root@'%' identified by '你的密碼' with grant option;

  flush privileges;

step5:遠程鏈接問題

  sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf

  註釋 bind-address = 127.0.0.1

 

擴展:

mysql -u root -p
insert into mysql.user(Host,User,Password values(‘localhost’,'jee’,password(‘jee’)); 
flush privileges;
grant select,insert,update,delete,create,drop on db.employee to jee@10.10.10.10 identified by ‘123′;

給來自10.10.10.10的用戶jee分配可對數據庫db的employee表進行
select,insert,update,delete,create,drop等操做權限,並設定口令爲123;

grant all privileges on db.* to jee@10.10.10.10 identified by ‘123′;
給來自10.10.10.10的用戶jee分配可對數據庫db全部表進行全部操做的權限,並設定口令爲123;
grant all privileges on *.* to jee@10.10.10.10 identified by ‘123′;
給來自10.10.10.10的用戶jee分配可對全部數據庫全部表進行全部操做的權限,並設定口令爲123;
給本機用戶jee分配可對全部數據庫全部表進行全部操做的權限,並設定口令爲123;grant all privileges on *.* to jee@localhost identified by ‘123′;
相關文章
相關標籤/搜索