当前位置:网站首页>Ubuntu manually installing MySQL
Ubuntu manually installing MySQL
2022-06-27 10:12:00 【Knowing and doing】
Download the installation package from the official website MySQL :: Download MySQL Community Server
Unzip to /usr/local Under the table of contents , Rename it to mysql
Then input the following command at the terminal :
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> cd mysql
shell> chown -R mysql . ( Don't forget the last point , The same below )
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
If an error is reported after this sentence is executed :
scripts/mysql_install_db: 244: ./bin/my_print_defaults: not found
Neither host 'ubuntu' nor 'localhost' could be looked up with
./bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
Input... At the terminal uname -a Command to view the system version , If the result is x86_64 It means that the system is 64 Bit , Did you download the wrong installation package ? Download it on the official website 64 A version of the , Unzip it to mysql Delete the table of contents , Re execute the above statement
If you report an error again :./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
That means there's something missing , Execute the following command :
sudo apt-get install libaio-dev
Execute after installation scripts/mysql_install_db --user=mysql This statement
Continue to execute subsequent commands :
shell> chown -R root .
shell> chown -R mysql data
Okay , Start below :
sudo ./support-files/mysql.server start
# /usr/local/mysql/bin/mysqld_safe --user=mysql &
cd /usr/local/mysql/bin // Get into bin Catalog
#mysql // function mysq command
If it doesn't start Or appear Can't connect to local MySQL server through socket '/tmp/mysql.sock'
resolvent : #cd /usr/local/mysql/support-files // Enter this directory
#./mysql.server start // Start it up You can generate /tmp/mysql.sock
If /tmp/mysql.sock No such file exists , And mysql Is in Open state ?
resolvent : #netstat -an | grep 3306 // see 3306 port
#ps -ef | grep mysql // lookup mysql process
# kill -9 Process number // Mandatory deletion mysql The process number of
#./mysql.server start // Start it up You can generate /tmp/mysql.sock
If the number is the same in any path mysql What can I do without the command ?
resolvent : modify /etc/profile file Add to the file
PATH=$PATH:/usr/local/mysql/bin/
export PATH ( Save to exit execution source /etc/profile)
The above operations are completely OK Execute... In any directory # mysql command
If you want to execute service mysql start or restart stop What to do with the order ? Can't be old #./mysql.server start
resolvent : take mysql.server Make a copy to /etc/rc.d/init.d I'll change my name mysql or Create a connection file
Suppose the current directory is /etc/rc.d/init.d
Such as : #cp /usr/local/mysql/support-files/mysql.server mysql ( Copy )
or : #ln -s /usr/local/mysql/support-files/mysql.server mysql ( Establish connection file )
Complete the above operations perform service mysql start (or restart stop)
Modify with the following command MYSQL password
# /usr/local/mysql/bin/mysqladmin -u root password yourpassword // The default installation password is empty , For the sake of safety, you must modify it immediately
# chmod 700 /etc/init.d/mysql
# chkconfig --add mysqld
# chkconfig --level 345 mysql on //copy A script setting of the compilation directory makes mysql It can run automatically every time it is started
# service mysql start
# netstat -atln
// start-up mysql service
// see 3306 Is the port open . Pay attention to opening the port in the firewall .
It can be used telnet localhost 3306 Let's test it , If there's a reaction , That means the installation is successful
?
边栏推荐
- leetcode:968. Monitor the binary tree [tree DP, maintain the three states of each node's subtree, it is very difficult to think of the right as a learning, analogous to the house raiding 3]
- Basic violin plot in R with plot
- 10 common website security attack means and defense methods
- js中的数组对象
- Use aspese slides to convert PPT to PDF
- Border affects the height of the parent element - solution
- The R language uses the preprocess function of the caret package for data preprocessing: Center all data columns (subtract the average value from each data column), and set the method parameter to cen
- 多线程实现 重写run(),怎么注入使用mapper文件操作数据库
- Location and solution of network connection failure of primary online mobile terminal Report
- 2021 CSP J2入门组 CSP-S2提高组 第2轮 视频与题解
猜你喜欢

In the three-tier architecture, at which layer is the database design implemented, not at the data storage layer?

别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!

你睡觉时大脑真在自动学习!首个人体实验证据来了:加速1-4倍重放,深度睡眠阶段效果最好...
![文件名设置导致writelines写入报错:OSError: [Errno 22] Invalid argument](/img/08/2d4f425e6941af35616911672b6fed.png)
文件名设置导致writelines写入报错:OSError: [Errno 22] Invalid argument

小哥凭“量子速读”绝技吸粉59万:看街景图0.1秒,“啪的一下”在世界地图精准找到!...
![[registration] infrastructure design: from architecture hot issues to industry changes | tf63](/img/75/b83aaf9610987f695eefe350f8170e.jpg)
[registration] infrastructure design: from architecture hot issues to industry changes | tf63

CPU design (single cycle and pipeline)

前馈-反馈控制系统设计(过程控制课程设计matlab/simulink)

产品力对标海豹/Model 3,长安深蓝SL03预售17.98万起

leetcode:522. 最长特殊序列 II【贪心 + 子序列判断】
随机推荐
片刻喘息,美国电子烟巨头禁令推迟,可暂时继续在美销售产品
Decompile the jar package and recompile it into a jar package after modification
Evolution of software system architecture
Prometheus alarm process and related time parameter description
Comparison between new and old interfaces
上周热点回顾(6.20-6.26)
迪米特法则
Explain the imaging principle of various optical instruments in detail
如何获取GC(垃圾回收器)的STW(暂停)时间?
2021 CSP J2 entry group csp-s2 improvement group round 2 video and question solution
torchvision. models._ utils. Intermediatelayergetter tutorial
Freemarker
openpyxl表格读取实例
10 常见网站安全攻击手段及防御方法
Advantages and disadvantages of distributed file storage system
分布式文件存储系统的优点和缺点
[noodle classic] Yunze Technology
Mongodb cross host database copy and common commands
Location and solution of network connection failure of primary online mobile terminal Report
Reorganize common shell scripts for operation and maintenance frontline work