mariaDB 普通用户远程连接

mugbya posted @ 2014年10月03日 22:42 in 未分类 , 2977 阅读

 env : vps  CentOS 6.5 x32

## 缘起

由于要在vps上搭建一个wordpress的站点,数据库无可避免,就选择mariaDB了。 但之前一直在本地使用这个东西,而且也只用root(默认)账户,所以在vps操作,很多都不知道: 如创建用户 ; 允许普通远程连接,禁止root账户远程连接。所以自己体会完记录下自己的操作,方便自己以后参照。

 

## mariaDB 创建用户

 > 我假定你已经做完初始化数据库的操作了(禁掉root的远程访问),然后在本地用root帐号连接数据库了。

   mysql -u root -p mysql 

你可以先查看下当前下的用户: 

     select user,host,password from user;

[mysql]>drop user ''@'localhost'; --删除不安全的账户

[mysql]>drop user root@'::1';

[mysql]>drop user root@127.0.0.1;

 

mariaDB 之前我一直不知道怎么创建用户的,不过我想,应该也像postgresql,有自己创建用户的命令才是。但是google未果,只好老实去官方看文档了。

mariaDB 创建用户的语法是:

CREATE USER user 
 [IDENTIFIED BY [PASSWORD] 'password']
 [, user [IDENTIFIED BY [PASSWORD] 'password']] 
 ...

 

 

 

 

 

f88tw┃华歌尔 说:
2020年3月04日 14:55

敬启者:个人小网站希望大家多多支持 感谢您对我们热心的支持 f88tw┃华歌尔┃I appreciate your kind assistance. f88tw|墓园|捡骨流程|捡骨费用|捡骨时间|禁忌|捡骨颜色|捡骨师|新竹|时间|台北|桃园|苗栗|头份|火化|晋塔|安葬|法事|捡骨|看日子|墓穴|墓园|坟墓|看日子|乞丐|http://mypaper.m.pchome.com.tw/f88tw

XE88 apk download 说:
2021年8月30日 00:11

I prefer merely excellent resources - you will see these people in:

Satta king 说:
2021年9月25日 05:21

You ought to basically fantastic not to mention solid advice, which means notice:

AP 10th Social Model 说:
2022年9月09日 22:21

Social Study is most important students to all students of AP 10th Class, here we have provided the study material with solved question bank for all government and private school TM, EM, UM and HM students in chapter wise from past years old exams and we have provided the AP 10th Social Model Paper 2023 Pdf suggested by subject experts. AP 10th Social Model Paper All BSEAP 10th class regular and private course students can follow the list of chapters under SSC Social Study to practice study material with previous question bank to get a better score in summative assessment (SA) and formative assessment (FA) SA-1, SA-2, FA-1, FA-2, FA-3, FA-4 along with Assignments exams previously called Unit Test-1, Unit Test-2, Unit Test-3, Unit Test-4 and Three Months.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter