Think LAMP - Web Development, Linux Administration and Networking

open source, programming, networking, system administration, linux, unix

Entries Tagged ‘MYSQL’

Removing Foreign Key Constraints In MYSQL

Some Mysql db is using innoDB which implements foreign key contraints. If you can’t drop or alter a table, check that it doesnt have foreign key contraints. Well, innoDB can be an angel or devil…
In mysql command line, check existence of foreign keys

show create table demographic_type
CREATE TABLE `demographic_type` (
`id` int(10) unsigned NOT NULL auto_increment,
`user_group_id` varchar(255) [...]

Retrieve Lost Password in MYSQL

Sometime, we forget the root password for mysql. It happened to me once in my company. The previous developer left and didn’t document where to look for passwords. Well, it is possible for the root user of the system to reset it anyway…
First shutdown mysql,
/etc/init.d/mysql stop
then
mysqld –skip-grant-tables –u root
mysql -u root
mysql> use mysql;
mysql> UPDATE [...]