Cherry
Cherry

Reputation: 43

Error while installing MYSQL

I was trying to install mysql in ubuntu. I applied following command for it

sudo apt-get install mysql-server-5.5

But got the following error.

Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.5_5.5.41-0ubuntu0.14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Please help me to solve the error.

Upvotes: 4

Views: 8199

Answers (4)

pedram shabani
pedram shabani

Reputation: 1680

I had this problem And with this method, the problem was solved

1-Get the list of MySQL packages installed on the system by executing the command

sudo dpkg -l | grep mysql

2-Remove the the packages shown above by executing the command

sudo apt-get --purge autoremove <packages from the step 1>

3-Delete /var/lib/mysql 4-To add MariaDB repository to Ubuntu, run the commands below to install the repository key to your system.

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

5-

sudo sh -c "echo 'deb [arch=amd64,i386] https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu '$(lsb_release -cs)' main' > /etc/apt/sources.list.d/MariaDB-10.2.list"

6-After that, run the commands below to install the latest version of MariaDB.

sudo apt-get update
sudo apt-get install mariadb-server mariadb-client

7-

cd /var/run
sudo cp mysqld/ mysqld.bc -rf
sudo chown mysql:mysql mysqld.bc/
sudo service mysql stop
sudo cp mysqld.bc/ mysqld -rf
sudo chown mysql:mysql mysqld -R
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

8-Now able to log in database using

mysql -u root

9-Then to update root password:

UPDATE user SET authentication_string=password('YOURPASSWORDHERE') WHERE user='root';
FLUSH PRIVILEGES;

Upvotes: 0

Tomas Romero
Tomas Romero

Reputation: 8698

Doing this solved it for me:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-5.5 mysql-server-core-5.5 sudo apt-get autoremove sudo apt-get autoclean sudo apt-get install mysql-server

Upvotes: 3

Navjot Singh
Navjot Singh

Reputation: 514

Try given commands.

sudo apt-get purge mysql-client-core-5.6
    sudo apt-get autoremove
    sudo apt-get autoclean
    sudo apt-get install mysql-client-core-5.5
    sudo apt-get install mysql-server 

Try this link

Upvotes: 0

SVTAnthony
SVTAnthony

Reputation: 461

seems like there's an error with one of the packages being installed or that quite never installed properly in the past.

http://ubuntuforums.org/showthread.php?t=1642173

here is a link that helps identify the package and how to correct it.

Upvotes: 0

Related Questions