当前位置:网站首页>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
边栏推荐
- nacos配置文件发布失败,请检查参数是否正确的解决方案
- Redis 实现限流的三种方式
- Witness the times! "The future of Renji collaboration has come" 2022 Hongji ecological partnership conference opens live broadcast reservation
- PMP是被取消了吗??
- Learning notes - steps of JDBC connection database operation
- MySQL common graphics management tools | dark horse programmers
- 奔赴山海之前,毕业季一定要做的那些事情
- PostgreSQL varchar[] array type operation
- XML语法、约束
- [to.Net] C set class source code analysis
猜你喜欢
小红书上的爱情买卖
赋能「新型中国企业」,SAP Process Automation 落地中国
Junit单元测试框架详解
pickle.load报错【AttributeError: Can‘t get attribute ‘Vocabulary‘ on <module ‘__main__‘】
The former 4A executives engaged in agent operation and won an IPO
C-end dream is difficult to achieve. What does iFLYTEK rely on to support the goal of 1billion users?
混沌工程平台 ChaosBlade-Box 新版重磅发布
MySQL common graphics management tools | dark horse programmers
Lumiprobe 活性染料丨吲哚菁绿说明书
白盒加密技术浅理解
随机推荐
学习笔记-JDBC连接数据库操作的步骤
Lake Shore continuous flow cryostat transmission line
有关 M91 快速霍尔测量仪的更多信息
B2B e-commerce platform solution for fresh food industry to improve the standardization and transparency of enterprise transaction process
奔赴山海之前,毕业季一定要做的那些事情
新版国标GB28181视频平台EasyGBS如何配置WebRTC视频流格式播放?
Junit单元测试框架详解
PostgreSQL varchar[] 数组类型操作
Three ways for redis to realize current limiting
Les canaux de culture intensive s'efforcent de développer Fu Xin et Wei Shi jiajie pour organiser une conférence de formation sur les nouveaux produits
论文阅读【Discriminative Latent Semantic Graph for Video Captioning】
下载(导出)pdf模板文件(比如:审批单),报错:Invalid nested tag *** found, expected closing tag ***
生鲜行业B2B电商平台解决方案,提高企业交易流程标准化和透明度
Chaos engineering platform chaosblade box new heavy release
Implement a Prometheus exporter
【英语语法】Unit1 冠词、名词、代词和数词
Lumiprobe free radical analysis h2dcfda instructions
【森城市】GIS数据漫谈(一)
How to solve the problem of splash screen when the main and sub code streams of easygbs are h.265?
Lake Shore M91快速霍尔测量仪