Showing posts with label mysql error. Show all posts
Showing posts with label mysql error. Show all posts

mysql 5.5 install error on ubuntu 14.04.4 libdbi error hashsum mismatch

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libd/libdbi-perl/libdbi-perl_1.630-1_amd64.deb  Hash Sum mismatch


download libdbi...deb file from here
http://packages.ubuntu.com/trusty/amd64/libdbi-perl/download
or
http://cz.archive.ubuntu.com/ubuntu/pool/main/libd/libdbi-perl/libdbi-perl_1.630-1_amd64.deb

dpkg -i libdbi-perl_1.630-1_amd64.deb
apt-get install mysql-server

mysql error #1005 - Can't create table (errno: 150) importing database from another server

http://stackoverflow.com/questions/9018584/error-code-1005-cant-create-table-errno-150/30102503#30102503
Reference link to stackoverflow

This could also happen when exporting your database from one server to another and the tables are listed in alphabetical order by default.
So, your first table could have a foreign key of another table that is yet to be created. In such cases, disable foreign_key_checks and create the database.
Just add the following to your script:

vim export.sql

use  databasename100;
SET FOREIGN_KEY_CHECKS=0;
..
..
...sql'sss ....

and it shall work.



Table ‘./mysql/user’ is marked as crashed and should be repaired

How to make mysql service online from crash!

mysqld started

[ERROR] /usr/sbin/mysqld: Table ‘./mysql/user’ is marked as crashed and should be repaired
[ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘./mysql/user’ is marked as crashed and should be repaired mysqld ended

Which means DB: /var/lib/mysql/mysql table: “user” has been crashed.

To resolve this issue, please perform the commands below:

]# service mysql start --skip-grant-tables

now with mysql started, you can repair the mysql/user table

]# mysqlcheck -r mysql user

After that,

]# service mysql stop

]# service mysql start

OR

mysql> use mysql;

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> check table user;
+————+——-+———-+———————————————————-+
| Table | Op | Msg_type | Msg_text |
+————+——-+———-+———————————————————-+
| mysql.user | check | warning | Table is marked as crashed |
| mysql.user | check | warning | 6 clients are using or haven’t closed the table properly |
| mysql.user | check | error | Record at pos: 24992 is not remove-marked |
| mysql.user | check | error | record delete-link-chain corrupted |
| mysql.user | check | error | Corrupt |
+————+——-+———-+———————————————————-+
5 rows in set (0.02 sec)

mysql> repair table user;
+————+——–+———-+——————————————+
| Table | Op | Msg_type | Msg_text |
+————+——–+———-+——————————————+
| mysql.user | repair | warning | Number of rows changed from 1384 to 1385 |
| mysql.user | repair | status | OK |
+————+——–+———-+——————————————+
2 rows in set (0.48 sec)

mysql> check table user;
+————+——-+———-+———-+
| Table | Op | Msg_type | Msg_text |
+————+——-+———-+———-+
| mysql.user | check | status | OK |
+————+——-+———-+———-+
1 row in set (0.02 sec)

mysql>

#service mysql start