In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about how to reinstall mysql in php in linux. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
Linux PHP re-install mysql: 1. Remove mysql by "sudo apt-get remove mysql-common";2. Clean up residual data;3. Reinstall mysql by "sudo apt-get install".
Operating environment: linux 5.9.8 system, PHP 7.1 version, Dell G3 computer
Linux PHP reinstalling MySQL
MySQL always reports an error, saying that the sock file does not exist, several methods on the Internet, change permissions, change the configuration file, the result is still unable to generate the.sock file normally. No way, delete, reinstall.
Delete completely:
Remove mysql
sudo apt-get autoremove --purge mysql-server-5.0sudo apt-get remove mysql-serversudo apt-get autoremove mysql-serversudo apt-get remove mysql-common //This is very important
Some of the above are actually redundant.
Clean up residual data
dpkg -l |grep ^rc| awk '{print $2}' |sudo xargs dpkg -P But the database file created still exists, and after reinstallation, it can still be used.
install MySQL
sudo apt-get install mysql-serversudo apt-get install mysql-clientsudo apt-get install php5-mysql //install php5-mysql is to connect php and mysql Once the installation is complete, MySQL Server should start automatically. You can check if MySQL Server is running by running the following command at a terminal prompt: sudo netstat -tap| grep mysql When you run this command, you can see lines like the following:
tcp 0 0 localhost.localdomain:mysql *:* LISTEN -
If the server does not function properly, you can start it with the following command:
sudo /etc/init.d/mysql restart
go to the MySQL
$mysql -uroot -p Administrator password
Configure MySQL administrator password:
sudo mysqladmin -u root password newpassword Thank you for reading! About "how to reinstall mysql php in linux" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.