当前位置:网站首页>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

边栏推荐
- Learning notes [Gumbel softmax]
- 新版国标GB28181视频平台EasyGBS如何配置WebRTC视频流格式播放?
- 生鲜行业B2B电商平台解决方案,提高企业交易流程标准化和透明度
- nacos配置文件发布失败,请检查参数是否正确的解决方案
- pickle.load报错【AttributeError: Can‘t get attribute ‘Vocabulary‘ on <module ‘__main__‘】
- Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
- Games202 operation 0 - environment building process & solving problems encountered
- XML syntax, constraints
- Lumiprobe free radical analysis h2dcfda instructions
- 【pytorch记录】模型的分布式训练DataParallel、DistributedDataParallel
猜你喜欢

Once the SQL is optimized, the database query speed is increased by 60 times

Solution of intelligent supply chain management platform in aquatic industry: support the digitalization of enterprise supply chain and improve enterprise management efficiency

Chaos engineering platform chaosblade box new heavy release

XML syntax, constraints

测试自学人必看:软件测试如何找测试项目?

白盒加密技术浅理解

CDGA|从事通信行业,那你应该考个数据管理证书

Superoptimag superconducting magnet system - SOM, Som2 series
![[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

kubernetes命令入门(namespaces,pods)
随机推荐
奔赴山海之前,毕业季一定要做的那些事情
[pytorch record] distributed training dataparallel and distributeddataparallel of the model
ECS summer money saving secret, this time @ old users come and take it away
精耕渠道共谋发展 福昕携手伟仕佳杰开展新产品培训大会
Nacos configuration file publishing failed, please check whether the parameters are correct solution
Learning notes - steps of JDBC connection database operation
Supervarimag superconducting magnet system SVM series
[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function
How to solve the problem of splash screen when the main and sub code streams of easygbs are h.265?
SuperVariMag 超导磁体系统 — SVM 系列
Cdga | if you are engaged in the communication industry, you should get a data management certificate
助力数字经济发展,夯实数字人才底座—数字人才大赛在昆成功举办
Dom4j parsing XML, XPath retrieving XML
PostgreSQL varchar[] 数组类型操作
Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
下载(导出)pdf模板文件(比如:审批单),报错:Invalid nested tag *** found, expected closing tag ***
sql查询去重统计的方法总结
indexof和includes的区别
Chinese and English instructions human soluble advanced glycation end products receptor (sRAGE) ELISA Kit
白盒加密技术浅理解