How to reinstall mysql in linux php
linux php method to reinstall mysql: 1. Delete mysql through "sudo apt-get remove mysql-common"; 2. Clean up the residual data; 3. Reinstall mysql through "sudo apt-get install" that is Can.
The operating environment of this article: linux5.9.8 system, PHP7.1 version, Dell G3 computer
linux php reinstall mysql
MySQL always reports an error, saying that the sock file does not exist. I tried several methods online, changed permissions, and changed the configuration file, but the result was that the .sock file still could not be generated normally. No way, delete and reinstall.
Completely delete:
Delete mysql
sudo apt-get autoremove --purge mysql-server-5.0 sudo apt-get remove mysql-server sudo apt-get autoremove mysql-server sudo apt-get remove mysql-common //这个很重要
Some of the above are actually redundant.
Clean up residual data
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P but the created database file still exists. After reinstallation, it still exists can use.
Install mysql
sudo apt-get install mysql-serversudo apt-get install mysql-clientsudo apt-get install php5-mysql //Installing php5-mysql is Once the installation is complete, the MySQL server should start automatically. You can check if the MySQL server is running by running the following command from the terminal prompt: sudo netstat -tap | grep mysql When you run the command, you can see lines similar to the following:
tcp 0 0 localhost.localdomain:mysql *:* LISTEN -
if server If it cannot run normally, you can start it with the following command:
sudo /etc/init.d/mysql restart
Enter mysql
$mysql -uroot -p administrator password
Configure the administrator password for MySQL:
sudo mysqladmin -u root password newpassword
Okay, done.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to reinstall mysql in linux php. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

PHP is suitable for web development and content management systems, and Python is suitable for data science, machine learning and automation scripts. 1.PHP performs well in building fast and scalable websites and applications and is commonly used in CMS such as WordPress. 2. Python has performed outstandingly in the fields of data science and machine learning, with rich libraries such as NumPy and TensorFlow.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip
