Title: Database syntax error
Last modified: September 1, 2016

---

# Database syntax error

 *  Resolved [iael](https://wordpress.org/support/users/iael/)
 * (@iael)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/database-syntax-error-1/)
 * Hello people,
 * I would like to ask you for your guidance on my mysql issue. Yesterday I was 
   trying to change my website url by making changes in my database records. When
   I was editing my wp_posts and paste the code for update a new site adress, which
   was:
 * UPDATE wp_posts SET post_content = replace(post_content, ‘[http://olddomain.com&#8217](http://olddomain.com&#8217);,‘
   [http://newdomain.com&#8217](http://newdomain.com&#8217););
 * I got the message that my syntax isn’t right. I freak out a little bit, and ctrl
   z undo the changes, but even though I restored the original code of wp_posts,
   I’m still getting this syntax error, which is:
 * #1064 – You have an error in your SQL syntax; check the manual that corresponds
   to your MySQL server version for the right syntax to use near ‘[value-1],`name`
   =[value-2],`slug`=[value-3],`term_group`=[value-4] WHERE 1′ at line 1
 * It’s very strange, because I noticed that I get the same error in other tables
   in the UPDATE section.
    And I’ts even more strange that even when I restored 
   the backup of my database, I’m still getting the same error. When I’m opening
   my website I get this nice, big “Error establishing a database connection.”
 * Would appreciate your assistance a LOT.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [jphase](https://wordpress.org/support/users/jphase/)
 * (@jphase)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/database-syntax-error-1/#post-7670062)
 * Hi iael,
 *  If you rename the WordPress directory on your server, switch ports or change
   the hostname [http://codex.wordpress.org/Moving_WordPress](http://codex.wordpress.org/Moving_WordPress)
   applies. Follow the instructions on that link to properly change your site URL.
 *  WordPress often stores serialized data which will break when a simple find/replace
   is ran on the domain string itself. The search/replace script by interconnectit(
   you can find a link to this in the moving wordpress link above) is my preferred
   method of doing this.
 *  Thread Starter [iael](https://wordpress.org/support/users/iael/)
 * (@iael)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/database-syntax-error-1/#post-7670135)
 * It’s a little bit different case because I didn’t move my website anywhere, and
   so I didn’t change any directory and ports etc. I just wanted to update the url’s
   of my new domain alone.
 * I’m not sure if I will follow now with the codex instructions it will be a solution
   if first I will not fix the database connection issue. I already try to change
   the url’s and even restored the previous ones (as I mentioned- I even import 
   the old database backup), but still I’m getting the database connection error.
 *  Thread Starter [iael](https://wordpress.org/support/users/iael/)
 * (@iael)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/database-syntax-error-1/#post-7670203)
 * OK, I resolved that.
 * I don’t know why but somehow the password in my wp-config file has changed and
   I needed to restore it to the proper one.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Database syntax error’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [iael](https://wordpress.org/support/users/iael/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/database-syntax-error-1/#post-7670203)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
