Questions tagged [mysql-5.1]

MySQL version 5.1 - please also tag with mysql for search purposes.

First released on Dec 01, 2008, MySQL 5.1 introduces the following features

296 questions
60
votes
6 answers

Why use WHERE 1 or WHERE 1=1?

Usually, if conditions are not required in our query statements, we don't use a WHERE clause. But I've seen a WHERE 1 clause being used in many places, even where other conditions are not present. Why is this done? Are there specific benefits to…
ursitesion
  • 2,061
  • 8
  • 32
  • 45
42
votes
5 answers

MySQL: How to create Column if not exists?

I am trying to create a Column for my table only if it does not exist. I have researched a lot but I could not find any solution yet. Is this really possible to conditionally create Column ?
zzzzz
  • 523
  • 1
  • 4
  • 5
31
votes
1 answer

Change existing datadir path

I want to change the datadir path in the my.ini file. The existing datadir path is C:/ProgramData/MySQL/MySQL Server 5.1/Data/ The size of my C: drive is 30 GB and the MySQL data folder is occupying 25 GB. So I want to change the datadir to…
naveen
  • 311
  • 1
  • 3
  • 3
28
votes
2 answers

`ERROR 1114 (HY000) the table ... is full` with innodb_file_per_table set to autoextend

I have a MySQL database that holds a large amount of data (100-200GB - a bunch of scientific measurements). The vast majority of the data is stored in one table Sample. Now I'm creating a slave replica of the database and I wanted to take the…
Petr
  • 537
  • 2
  • 5
  • 11
22
votes
1 answer

How soon after updating expire_logs_days param and restarting sql will old binlogs get deleted?

MySQL 5.1.x | InnoDB | Windows My mysql data directory is starting to fill up with bin logs. I currently have the following settings configured in my windows mysql server:…
Mike B
  • 617
  • 4
  • 10
  • 17
19
votes
1 answer

How to get rid of "maximum user connections" error?

I am using MySQLi for my webapp but whenever I want to visit some particular page, I get mysqli_connect() [function.mysqli-connect]: (42000/1203): User ***_user already has more than 'max_user_connections' active connections. I tried already to…
ahmed
  • 293
  • 1
  • 2
  • 4
18
votes
2 answers

What can we do in MySQL 5.0 Replication to address bandwidth concerns?

I am developing an application to run on the client PC (Win) which is configured with a MySQL server 5.1 instance that will act as read-only slave to the remote master. The remote master has dozens of schemas, but I only need one per client so I…
Abram
  • 283
  • 2
  • 6
16
votes
2 answers

Reasons for occasionally slow queries?

We are running MySQL 5.1 on Windows Server 2008 R2. We have been doing some diagnostics on our database of late and have found some disturbing artifacts which we can't explain. We added some code to log when we had queries that took a long time (>…
RedBlueThing
  • 600
  • 6
  • 16
15
votes
4 answers

Can I make sure two columns dont have the same value

If I have a table that looks like this CREATE TABLE foo ( id INT NOT NULL AUTO_INCREMENT, aa INT NOT NULL, bb INT NOT NULL, PRIMARY KEY (id), UNIQUE KEY (aa, bb), CONSTRAINT aa_ref FOREIGN KEY (aa) REFERENCES bar (id), …
Nifle
  • 1,472
  • 8
  • 17
  • 31
14
votes
3 answers

How do I output MySQL logs to syslog?

I want to use syslog for logging MySQL(5.1.41) on Ubuntu(10.04 LTS). I found information that output error log to syslog. [mysqld_safe] syslog But I want to use syslog for logging general logs and slow query logs. Please advise me how to write…
inohiro
  • 345
  • 2
  • 3
  • 9
14
votes
2 answers

innodb_flush_method=O_DIRECT vs O_DSYNC performance impact on ext3 with LVM disk partition

In one of my production environments, we have two instances running on a RedHat cluster, with one production instance associated with the cluster. We have 125G main memory with 24G InnoDB buffer pool occupied by instance1 & 12G occupied by…
Gopinath Karangula
  • 933
  • 2
  • 10
  • 21
12
votes
3 answers

Is there any command to optimize all MySQL tables one by one automatically?

I execute below command line statement to optimize a table: optimize table tablename; Is there any command or statement which can optimize all the tables one by one of the selected database?
ursitesion
  • 2,061
  • 8
  • 32
  • 45
12
votes
2 answers

Adding a user to MySQL with 'name'@'%' fails with ERROR 1396

I just tried to add a new user to MySQL using CREATE USER 'name'@'%' IDENTIFIED BY '...' However, it fails with the following error: ERROR 1396 (HY000): Operation CREATE USER failed for 'name'@'%' Adding the user just for localhost works…
Petr
  • 537
  • 2
  • 5
  • 11
12
votes
3 answers

MySQL replication - slave is continuously lagging behind master

I am using MySQL-5.1.50 with a Master-slave replication setup. Most of the time the slave is lagging behind the master. When I run show processlist;, there is no query that's taking a long time. I enabled slow_log as well. However, it does not…
adeela sahar
  • 121
  • 1
  • 1
  • 3
10
votes
1 answer

Why mysql 5.5 slower than 5.1 (linux,using mysqlslap)

my.cnf (5.5 and 5.1 is the same)…
Koerr
  • 251
  • 2
  • 7
1
2 3
19 20