Database Software

byo71's picture

search and replace in mysql

Communications | Database Software

can also be used in phpmyadmin

UPDATE tablename SET tablefield = replace(tablefield, "findstring", "replacestring");

very handy for changing all entries in one field to another value

How to enable remote access to your mysql database (debian)

Communications | Database Software

1) nano /etc/mysql/my.cnf
2) find

[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/English
bind-address = 65.55.55.2

3) the bind address will initially say localhost... change it to be your ipaddress of the server.
4) /etc/init.d/mysql restart
5) modify the permissions in mysql to allow remote users to log in.

thats it your done.

how to repair a damaged mysql table

Communications | Database Software

Just a few minutes ago, i encounted a fairly common problem that would be hard to figure out without someone telling you how to do it. A server with mysql server quit working and we were getting die errors every time we tried to connect to the database. Wanna know how i fixed it?? well here you go...

1) log on to the linux console

2) restart the mysql server

/etc/init.d/mysqld restart

(this works on debian)

3) connect to the sql server

mysql -u=root -p

(note root is the root user for mysql)

4)

mysql> show databases;

XML feed