当前位置:网站首页>Ubuntu14 install MySQL and configure root account local and remote access
Ubuntu14 install MySQL and configure root account local and remote access
2022-07-01 19:30:00 【Infinitesimal pawn】
install
Ubuntu14 apt Install default installation mysql5.5 edition .
1、sudo su # Switch administrator user
2、sudo apt-get install mysql-server #apt install
3、 You will be asked to confirm during the installation , Input y that will do .

4、 Next, a window will pop up for you to enter root User's password , Be sure to remember , Otherwise, it will be troublesome . Then confirm the input you just entered root User's password .
Input... For the first time :

Second input :

5、 installation is complete

Configure remote access
First of all, please make sure that your server entry and exit rules have been opened 3306 port .
1、 Get into mysql The installation directory command :cd /etc/mysql
2、 see mysql Files in the folder command :ls
![]()
3、 modify my.cnf file
command 1:vim my.cnf # edit my.cnf file

command 2: Press i Insert edit .
stay [mysqld] Add... To any of the following lines “skip-grant-tables”( notes :skip-grant-tables: Do not start grant-tables Authorization Form . Its function is MYSQL The server does not load the permission judgment ,mysql Any user in can access the database ).
In addition, you must also bind-address = 127.0.0.1 It is amended as follows bind-address = 0.0.0.0( notes : This is the host that will access the database ip Set to any ip It means )

command 3: According to the first esc Exit edit mode
command 4: Input :wq Press enter save exit .
4、 restart mysql
command :service mysql restart (mysql5.5 The restart command for , If you are mysql5.7 Or above version please use service mysqld restart)
5、 Sign in mysql
command :mysql -u root -p
6、 Refresh the permissions , If you don't refresh, it will , An error is reported when authorizing ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement. important
command :flush privileges;
7、 to grant authorization
command :grant all privileges on *.* to [email protected]'%' identified by "password"; ( Authorize to add remote access root User's command )
8、 see user=root,host=% Whether it was successfully added to the authorization table .
command :select user,host,password from mysql.user;

9、 Unified modification root User's password , Added in the previous step root The user password is authorized according to the previous step by The following values generate hash value .
command :
1)use mysql;
2)update user set password=password("123456") where user="root";(MySQL5.5 Set password for ,MySQL5.7 And above, please use mysql> update user set authentication_string=password("123456") where user="root";)

10、 Refresh the permissions important
command :flush privileges;
11、 sign out
command :quit;
Remote client connection

边栏推荐
- Implement a Prometheus exporter
- torch.nn.functional.interpolate函数
- Contos 7 搭建sftp之创建用户、用户组以及删除用户
- 3. "Create your own NFT collections and publish a Web3 application to show them" cast NFT locally
- Lake Shore—CRX-EM-HF 型低温探针台
- Lean thinking: source, pillar, landing. I understand it after reading this article
- [go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function
- 赋能「新型中国企业」,SAP Process Automation 落地中国
- 241. Different Ways to Add Parentheses
- How to solve the problem of splash screen when the main and sub code streams of easygbs are h.265?
猜你喜欢

Dlib+opencv library for fatigue detection

Netease games, radical going to sea

云服务器ECS夏日省钱秘籍,这次@老用户快来领走

The former 4A executives engaged in agent operation and won an IPO

Manufacturing SRM management system supplier all-round closed-loop management, to achieve procurement sourcing and process efficient collaboration

【直播预约】数据库OBCP认证全面升级公开课

Bao, que se passe - t - il si le serveur 100 + O & M a mal à la tête? Utilisez le majordome xingyun!
![[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function](/img/1e/bed6a761f07c052e43b1e3b1701760.png)
[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function

Is PMP cancelled??

【To .NET】C#集合类源码解析
随机推荐
Dlib+opencv library for fatigue detection
Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
MySQL common graphics management tools | dark horse programmers
MATLAB中subplot函数的使用
[pytorch record] automatic hybrid accuracy training torch cuda. amp
Solidity - contract structure - error - ^0.8.4 NEW
The market value evaporated by 74billion yuan, and the big man turned and entered the prefabricated vegetables
Methods of finding various limits
[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function
Lumiprobe 细胞成像研究丨PKH26细胞膜标记试剂盒
Lumiprobe 活性染料丨吲哚菁绿说明书
Learning notes [Gumbel softmax]
求各种极限的方法
物联网平台thingsboard搭建学习记录
Manufacturing SRM management system supplier all-round closed-loop management, to achieve procurement sourcing and process efficient collaboration
Bao, que se passe - t - il si le serveur 100 + O & M a mal à la tête? Utilisez le majordome xingyun!
智慧防疫系统为建筑工地复工复产提供安全保障
【6.24-7.1】写作社区精彩技术博文回顾
见证时代!“人玑协同 未来已来”2022弘玑生态伙伴大会开启直播预约
Intensive cultivation of channels for joint development Fuxin and Weishi Jiajie held a new product training conference