MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
27 views

MySql Insert signal if where clause fails

As part of a chained sequence of transactional queries, I'm inserting values that exist in a temporary table into a new table. Every query is validated for errors in PHP using: if ...
0
votes
1answer
187 views

Update query in a trigger

I have a configuration table: Table: refdatecol - id int(11) startdatecol varchar(100) enddatecol varchar(100) datecolTable varchar(100) This table holds the user configured column names ...
1
vote
1answer
26 views

Is there another/better way to create and maintain large amounts of procedures?

So I've decided to take a step back, and scrutinize the way I implement procedures on my databases. I'll list what I have done, give my reason for doing so and hopefully I will be told that I'm a ...
1
vote
1answer
4k views

Amazon RDS - Can't connect to MySQL database server?

So I've been working on this issue for a while now, and I'll explain what I'm trying to do. I'm trying to connect to a MySQL database server, hosted by Amazon Web Services in the Amazon RDS service. ...
1
vote
2answers
29 views

MySQL “case as column” question in WHERE clause

I'm setting up a new column with this case statement: SELECT * , CASE t2.field_max_occupancy_value WHEN 'one' THEN 1 WHEN 'two' THEN 2 WHEN 'three' THEN 3 WHEN 'four' THEN 4 WHEN 'five' ...
0
votes
1answer
305 views

How to automatically Reset Query Cache for improve table cache hit in MySQL?

I have a VPS running CentOS 6.4 and 2.5GB RAM, Intel(R) Xeon(R) CPU. Its MySQL version is Server version: 5.5.35-cell. I have two active wordpress sites and two inactive sites (inactive sites use for ...
0
votes
1answer
42 views

Filter from the same user times

i have a table with user id-s, and many times for the same users, like this: id time 1 13:00:01 1 13:00:01 2 13:00:09 1 13:00.23 1 13:00:24 2 13:00:11 2 13:00:11 I ...
0
votes
1answer
227 views

MySQL 5.6 replication causes 'waiting for table lock'

All of the sudden queries on slave server stopped with status "Waiting for table level lock" I restart mysql service and stop replications and locking does not show up anymore. Once I turn ...
0
votes
1answer
24 views

Showing all values when at least match a given one

Given three tables items, genres and itemGenres; how can I filter out the items that have at least the given value while also outputting the rest of its genres. With this data INSERT INTO items ...
1
vote
3answers
37 views

guideline for calling optimize table after alter table?

Should I be calling 'optimize table' when changing datatypes of columns, adding indexes or dropping indexes, assuming a table with millions of rows, heavily used, both for reading and writing ...
0
votes
1answer
879 views

#1044 - Access denied for user '#username'@'10.%' to database '#database'

I'm trying to connect my webpage to mySQL with ipage hosting. When I copy the snippet: <?php $link = mysql_connect('username.ipagemysql.com', 'username for mySQL', 'password for mySQL'); if ...
2
votes
2answers
37 views

How can I Search for a string in all fields across all tables of a MySQL database?

I want to find a string and I don't know exactly which column and which table. How can I find it? Thanks.
1
vote
0answers
20 views

Mysql binlog warnings [closed]

My system happens to write a lot of unsafe statements to the binlog and the result is a lot of IO wasted. I found that turning the warnings off in the log fixes the problem but i was wondering if ...
0
votes
1answer
20 views

Unable to show binary logs how to remove logs from mysql?

Server version: 5.1.50-log MySQL Community Server (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show binary logs ; PROBLEM Data directory is full I want to remove ...
0
votes
1answer
151 views

MySQL Subquery Returns Null In Stored Procedure, Works Fine In Query

I have a subquery in a MySQL Stored Procedure where the value returns null even though the data is clearly there. Pulling the subquery out and running it works fine. I've checked the parameter values ...
0
votes
1answer
34 views

How to insert multiple values in a specific field in a table using mysqli?

I am working on a project and I I have a scenario like this: I have many field in my table : table_name : transaction_tbl -id -name -description -ref_number : text(datatype) In my inserting here is ...
0
votes
1answer
14 views

MySQL database dump bombs out Error 1064 when using LOCK TABLES

This specific machine is running MySQL version 5.0.27. I have tried to get a full dump of this database several times and each time it bombs out. Tried getting just a structure dump of it and this is ...
6
votes
3answers
3k views

How can I improve my SQL statement with weekly results with week starting on Thursday or any other day of the week?

I am a total newb, and I couldn't find a good way to do this anywhere. I have a database table that contains statistics that are recorded at various time throughout the week. The reporting week ...
1
vote
1answer
38 views

Multiple left join where not in another table

I have the following tables (there is more detailed data in each one, I just put the minimum to create a sample): __________ _____________ _____________ _____________ | person | | provider | | ...
0
votes
2answers
59 views

How can i update my database from another database using temporary tables?

I want to update tables of my database using another big database every day with using temporary tables and without returning result. How can i update it? This my temporary table : use data_pro; ...
0
votes
0answers
24 views

Is there an equivalent in postgresql to MySQL's “safe update mode” or “safe delete mode”?

Is there a configuration or flag in PostgreSQL I can turn on to disable bulk updates and bulk deletes, similar to MySQL's "safe update mode" or "safe delete mode"?
1
vote
2answers
1k views

mysql.sock not found on CentOS 7 machine

I am getting the following error when I try to log into mysql from the CentOS 7 terminal of the machine where mysql is installed: ERROR 2002 (HY000): Can't connect to local MySQL server through ...
1
vote
1answer
352 views

Syncronize mysql databases between local and hosted servers automatically

We have many website with Development , Staging and Production Server. we have many developers for many projects, we need a solution to synchronize the database with developer database with staging ...
0
votes
1answer
12 views

Mysql: Create a view with multiple self joins without duplicates in result

Just to clarify i can't change the tables structure, so please leave out the "you should change your tables to this and that" answers, thank you. So i have a table entities_attributes_values where an ...
0
votes
1answer
124 views

How to track only DDL statements executed in MySQL

Can we track only executed DDL statements in MySQL but not DML statements. I dont want to use either binlog/general log to enable. I just wanted to track only DDL statements. I had gone through the ...
0
votes
0answers
21 views

How to get one result with multiple data in other table [migrated]

My problem is this. I want to put table1 in combo box with one result with different data from table2. I hope you can get my point.. sorry.. :) My tables: This is my coding. ...
2
votes
1answer
758 views

SQL set profiling

I'm setting up an automatic database backup for a website. When I try to do a backup it comes up with the error" MySQL error: The 'SHOW PROFILE' feature is disabled; you need MySQL built with ...
1
vote
0answers
28 views

Mysql master slave performance

Im running a mysql database on a linux server with 24gb ram and im trying to run a performance test of my system. Now the thing is, when im running it without a slave replication and in particular, ...
0
votes
1answer
185 views

Using non-replicated read/write databases on a MySQL slave server

I have a MySQL slave server that has two databases being replicated from a master. What I'd like to do is add a third database that I will exclude from replication and use as a read/write database. ...
0
votes
1answer
668 views

INSERT take too much time

I have in my MySQL DB a few tables Most of the time, I'm only doing INSERT in my db. I have up to 4 connections to the DB, each one inserting into a different table. There cannot be two connections ...
0
votes
2answers
16 views

How to check innodb history list length?

The output for show engine innodb status has the history list length as a number, but that output is hard to parse, and there's just too much data when all you want is a single value. Is the value ...
0
votes
2answers
576 views

Can't get mysql running

After canceling an Ubuntu upgrade, Mysql refuses to start. this is what I get when I try to run it : $ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket ...
0
votes
2answers
206 views

What's faster: two UPDATEs with WHERE (in / not in) or one UPDATE with CASE?

What's best performance wise, two separate UPDATEs: UPDATE table1 SET enabled = 0 WHERE code NOT IN ( SELECT id FROM table2 ); UPDATE table1 SET enabled = 1 WHERE ...
1
vote
1answer
21 views

How do I get the MySQL binary log coordinates from the binary files?

I'm attempting to set up replication for a large (120 GB) MySQL database and I messed up. I shut down the master, copied the data files, and restarted the master. Now I've set up the slave & ...
1
vote
2answers
50 views

How is MySQL using an index when doing a case sensitive comparison?

I noticed that Ruby on Rails (ActiveRecord) was using the BINARY operator for a case sensitive comparison. Yet, when I look at the EXPLAIN for this, MySQL can still use the appropriate index for a ...
1
vote
1answer
19 views

MySQL Read/Write Benchmark

I'm trying to benchmark Read/Write speed in MySQL 5.5. Currently I have a stored procedure that insert rows with random numbers to a table and I'm measuring time of execution before and after ...
0
votes
1answer
398 views

MyISAM : Should I be concerned by these warnings?

I restored some tables from recent Databases backups. Because Im supporting a legacy system that only uses MyISAM tables in their DBs, for backing up I used a little script that pretty much copies all ...
1
vote
1answer
22 views

To find out the sum total of GRNQty and GRNValue of particular item from column 1

Query 1 # SELECT spi.Item,spi.ItemName,supdd.PackageID,spi.Specifics,iteb.brandname,supdd.Qty AS GRNQty,supdd.GP AS UnitPrice,(supdd.Qty * Supdd.GP) AS GRNValue FROM suppdeldetail AS supdd ...
0
votes
0answers
15 views

Error 1911 'STATS_PERSISTENT' [closed]

When I run the code mysql -u root -p < cpt-all-db.sql and then enter my password I get the error code ERROR 1911 (HY000) at line 6609: Unknown option 'STATS_PERSISTENT On line 6609 this is the code ...
7
votes
3answers
12k views

How to easily convert utf8 tables to utf8mb4 in MySQL 5.5

I have a database which now needs to support 4 byte characters (Chinese). Luckily I already have MySQL 5.5 in production. So I would just like to make all collations which are utf8_bin to ...
0
votes
1answer
419 views

MySQL General error: 126 Incorrect key file for table '/tmp/#sql_27e6_0.MYI'; try to repair it'

I have a table in MySQL with ~2,000,000 rows. When I try to select all records, it exhausts the system's memory and I get an error about memory exhaustion back. When I try to use the MySQL LIMIT and ...
0
votes
0answers
25 views

Error 1248: Every derived table must have its own alias [closed]

Please see my code, below. I get the error: Error 1248: Every derived table must have its own alias What am I doing wrong? CREATE PROCEDURE `insert_seance` (IN compared_id INT) BLOCK1: BEGIN ...
4
votes
2answers
198 views

Problem in Fetching Result set in Desired Format

I have 2 tables having the following columns Person ------ person_id, first_name, middle_name, last_name Items ----- person_item_id, person_id, item_type, status, ordered_date The query is ...
0
votes
0answers
67 views

Ideas for Database schema for Automotive web app

For the last couple of days I have been searching all over Google for database schema for my automotive web application [like a marketplace of sort] (in Laravel 5 PHP). I have tried many models some ...
-3
votes
1answer
42 views

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

On my local WAMP stack things are working perfectly. When I upload the database on GOdaddy.com, this error shows up. Warning: mysqli_connect(): (HY000/1045): Access denied for user ...
2
votes
1answer
649 views

MySQL (or MariaDB) multi-master without MMM

I've been reading blogs on MySQL multi-master setup. The way I've used MySQL replication in the past was master-slave where if the master died (or was being taken down for maintenance) we would shut ...
0
votes
1answer
910 views

How to start mysqld with read-only data directory?

I'm trying to start MariaDB in a docker container, using a data directory from the host mounted read-only. MySQLd is of course shut down on the host. Unfortunately, even with adding the read_only flag ...
3
votes
0answers
69 views

Why the stored procedure is much slower than a temporary table?

I want to do the updating of my database every day and I will like to use stored procedures but the time of execution of the temporary table is faster than the stored procedure. How can I optimize my ...
1
vote
1answer
39 views

comparing ip and subnet (ipv4 and ipv6) - mysql

How can I check if an ipaddress is part of a subnet, given ipaddress can be ipv4 or ipv6? I currently have it working for ipv4 only: set @ip = '1.1.1.1'; set @subnet = '1.1.1.0/32'; set ...
1
vote
1answer
16 views

Root Remove Remote % host. My SQL

So i accidentally made it so root can be accessed anywhere remotely how do i revoke the % privilege. Using mysql. +-----------+ | host | +-----------+ | % | | 127.0.0.1 | | ::1 | | ...