Quantcast
Channel: MySQL Forums - Database Administration & Monitoring
Viewing all 812 articles
Browse latest View live

MySQL User and DB Tables (1 reply)

$
0
0
Hello,

I am running MySQL Server 5.1.71 on FreeBSD 64Bit platform that was setup by another DBA originally and I'm now the DBA. Today I noticed that there are entries in the mysql.user table that do not have entries in the mysql.db table.

I've read up on the Reference guides:
http://dev.mysql.com/doc/refman/5.1/en/default-privileges.html
http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

but not quite sure why there would be a need to have accounts in the user table with no entries in the db table. As far as I know, this would mean the user can log in, but has no permissions to any database. If that is true, what would be the use of those accounts?

To make it more odd, I do know that one of the accounts is being used to run queries against a db (via php scripts), but how is that possible if there is no entry in the db table? Or did I miss something...

Thanks for the help!

cannot create new thread (1 reply)

$
0
0
Hi all,
We are using mysql 5.5.30 version.Recently we have upgraded from 5.1.
But now we met cannot create new thread issue.
Our soft nproc value=1024.
Hard nproc=unlimited
RAM=12GB
Buffer pool size=6 GB
thread concurrency=0

May i know the source for this issue.

Regards
siraj.j

MySQL Service was suddenly shutted down (1 reply)

$
0
0
I have installed MySQL Server 5.5 on the Windows Server 2008 R2. In the services.msc I see that it has the Startup Type option set to Automatic. Everything was fine until today when that service was somehow turned off, but I did not do this.

So,

1) what can makes that service to be shutted down ?

2) Maybe is there any error log ?

3) Is it possible to set that service to be automatically turned on if that situation will come again ?

How to connect with Workbench to server in shared-memory mode ? (1 reply)

$
0
0
I have installed MySQL Server 5.5 on Windows Server 2008 R2 (and on Windows 7 for DB design purpose) and have configured it to shared-memory mode. Evetything is fine, but I have also installed Workbench program but I can't connect to the service - I get the Can't connect to MySQL server on '127.0.0.1' (10061) error. So, how to connect to that server using localhost ?

flush tables with read locks or lock tables write/read (no replies)

$
0
0
Hi,
which tables or variables can I query to see if a specific table or tables have a read or write lock?

f.ex.:
flush tables with read lock
or
lock tables x with read or lock tables y with write

I was not able to find f.ex. a table in the information_schema that shows me if a table or more tables have a read or write lock.

Thx for helping!

how to design table with 30,000 insertion every 15 minutes? (no replies)

$
0
0
hii all,

I am trying to design a database table which will be going to face 30,000 insertion in every 15 minutes. So this tables going to face millions of insertion.

A sample table is as follow-

CREATE TABLE `cdr` (`id` bigint(20) NOT NULL AUTO_INCREMENT,
`dataPacketDownLink` bigint(20) DEFAULT NULL,
`dataPacketUpLink` bigint(20) DEFAULT NULL,
`dataPlanEndTime` datetime DEFAULT NULL,
`dataPlanStartTime` datetime DEFAULT NULL,
`dataVolumeDownLink` bigint(20) DEFAULT NULL,
`dataVolumeUpLink` bigint(20) DEFAULT NULL,
`dataplan` varchar(255) DEFAULT NULL,
`dataplanType` varchar(255) DEFAULT NULL,
`createdOn` datetime DEFAULT NULL,
`deviceName` varchar(500) DEFAULT NULL,
`duration` int(11) NOT NULL,
`effectiveDuration` int(11) NOT NULL,
`hour` int(11) DEFAULT NULL,
`eventDate` datetime DEFAULT NULL,
`msisdn` bigint(20) DEFAULT NULL,
`quarter` int(11) DEFAULT NULL,
`validDays` int(11) DEFAULT NULL,
`dataLeft` bigint(20) DEFAULT NULL,
`completedOn` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `msisdn_index` (`msisdn`),
KEY `eventdate_index` (`eventDate`)
) ENGINE=MyISAM AUTO_INCREMENT=55925171 DEFAULT CHARSET=latin1;

How I can retrieve records if use comparison >= in case of date column(result in millions of record).
So please help me to design such table, so i can use optimized select statements without effecting insertion operation(lot of indexes create problem for insertion after millions of records).
Thank you.

is it good add 3 index on a table with 30,000 insert in every 15 minutes? (no replies)

$
0
0
I have to make a table with 6-7 partition like this -


CREATE TABLE test_cdr
( `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`dataPacketDownLink` BIGINT(20) DEFAULT NULL,
`dataPacketUpLink` BIGINT(20) DEFAULT NULL,
`dataPlanEndTime` DATETIME DEFAULT NULL,
`dataPlanStartTime` DATETIME DEFAULT NULL,
`dataVolumeDownLink` BIGINT(20) DEFAULT NULL,
`dataVolumeUpLink` BIGINT(20) DEFAULT NULL,
`dataplan` VARCHAR(255) DEFAULT NULL,
`dataplanType` VARCHAR(255) DEFAULT NULL,
`createdOn` DATETIME DEFAULT NULL,
`deviceName` VARCHAR(500) DEFAULT NULL,
`duration` INT(11) NOT NULL,
`effectiveDuration` INT(11) NOT NULL,
`hour` TINYINT(4) DEFAULT NULL,
`eventDate` DATETIME DEFAULT NULL,
`msisdn` BIGINT(20) DEFAULT NULL,
`quarter` TINYINT(4) DEFAULT NULL,
`validDays` INT(11) DEFAULT NULL,
`dataLeft` BIGINT(20) DEFAULT NULL,
`completedOn` DATETIME DEFAULT NULL,
`evedate` DATE DEFAULT NULL,
PRIMARY KEY (`id`,`evedate`),
KEY `evedate_index` (`evedate`),
KEY `hour_index` (`hour`),
KEY `msisdn_index` (`msisdn`) )
ENGINE=MYISAM
PARTITION BY RANGE COLUMNS(evedate)(
PARTITION p01 VALUES LESS THAN '2013-9-07'),
PARTITION p02 VALUES LESS THAN ('2013-09-10'),
PARTITION p03 VALUES LESS THAN '2013-09-18'),
PARTITION p04 VALUES LESS THAN ('2013-09-23'),
PARTITION p05 VALUES LESS HAN ('2013-09-25'),
PARTITION p06 VALUES LESS THAN ('2013-09-27'),
PARTITION p07 VALUES ESS THAN ('2013-10-01'),
PARTITION p08 VALUES LESS THAN (MAXVALUE));

Is it good to make this indexes on this table(with 40+ millions row), because we are going to insert 30,000 records in every 15 minutes. But I also dont want to hurt insert operations? Indexes are too required for fast queries.

So please tell me some intermediate solution for this.

Thank you.

Warning: Skipping the data of table mysql.event. Specify the --events option explicitly. (no replies)

$
0
0
Hi all,

Just wondering if anyone has any insights on this error.

Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.

It seems I am to append a --events flag in my mysqldump command line. However, this also seems to be a feature that will only be introduced in 5.1.8.

Is there any way to circumvent this using MySQL 5.1.69, as I have a daily cron monitor that sends emails if a warning is triggered during daily dumps. If possible, I'd prefer not to upgrade my version of MySQL 5.1.69, so a solution using 5.1.69 would be grand.

Cheers

Mysql 5.5 taking too much time to execute. (2 replies)

$
0
0
Hi all,
We were using MySql 5.1.Now we have upgraded to MySql 5.5.
In mysql 5.5,queries taking too much time to execute compared to mysql 5.1.At the same time i was trying to execute same query continuously in 5.5.Very first time data will be fetching from db.Second and third times data comes from buffer pool.So retrieval will be speed.But in mysql 5.5 query execution time was approximately same for all times.Shall i know the reason

How to avoid temporary table in sql query? (no replies)

$
0
0
I am running a query (taking 3 minutes to execute)-

SELECT c.eveDate,c.hour,SUM(c.dataVolumeDownLink)+SUM(c.dataVolumeUpLink)
FROM cdr c
WHERE c.evedate>='2013-10-01'
GROUP BY c.hour;

with explain plan -

id 1
select_type SIMPLE
table c
type ALL
possible_keys evedate_index,eve_hour_index,eve_msisdn_index
key null
key_len null
ref null
rows 79200000
Extra Using where; Using temporary; Using filesort

I am using table(Myisam)-

Primary key(id,evedate),

with weekly 8 partitions with key evedate,

index key- on evedate,

composite index on (evedate,hour) and (evedate_msisdb).

I have changed the mysql tuning parameters from my.ini as (4GB RAM)-

tmp_table_size=200M

key_buffer_size=400M

read_rnd_buffer_size=2M

But still its using temporary table. Please let me know what should I do to exclude this.

After adding new composite index(evedate,msisdn)

I have found some changes in few queries they were not using any temporary table, even in above query if I omit group by clause, its not using temporary table.

Thank you.

Created_tmp_disk_tables Issue (no replies)

$
0
0
Hi all,
We are using MySql 5.5.While we are running a small select statement it increments "Created_tmp_disk_tables" parameter.

for ex:
DROP TABLE IF EXISTS TEST_TBL`;
CREATE TABLE TEST_TBL` (
`COL_1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO TEST_TBL
VALUES(1);

SELECT * FROM TEST_TBL;

Here create statement increments "Created_tmp_disk_tables".
And select statement also increments "Created_tmp_disk_tables".

May i know the reason for this?

how could i know when table is created. (6 replies)

$
0
0
hi. i'm making some program that using mysql.
create table query is included in some library.
and unfortunately i can't touch that library.
so, i'm looking for a way let me know when table is created.

is it possible?

thank you for reading my topic.

Dead lock due to foreign key: how to resolve (no replies)

$
0
0
I know exactly how the dead lock happened which is shown below,
but I do not know what I should do to prevent it from happening.
Please help.

0 - set up

mysql> create table PAY_ARGMT (id int, b int, primary key (id));
Query OK, 0 rows affected (0.21 sec)

mysql> create table PAY_TRAN (id int, PAY_ARGMT_ID int, foreign key (PAY_ARGMT_ID) references PAY_ARGMT(id) );
Query OK, 0 rows affected (0.24 sec)

mysql> insert into PAY_ARGMT values (10,10);
Query OK, 1 row affected (0.00 sec)

mysql> commit;
Query OK, 0 rows affected (0.10 sec)

1 - dead lock

session 1:
mysql> insert into PAY_TRAN values (1, 10);
Query OK, 1 row affected (0.00 sec)

session 2:
mysql> insert into PAY_TRAN values (2, 10); # Lock PAY_ARGMT ID=10 because of FK
Query OK, 1 row affected (0.00 sec)

session 1:
mysql> update PAY_ARGMT set b=11 where id=10; # Locked by Session 2

session 2:
mysql> update PAY_ARGMT set b=12 where id=10;
ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction

MySQL 5.5 UTC importing to MySQL 5.6 EST (no replies)

$
0
0
Hi!

Is it possible to define seprate time zones for each database/schema on MySQL 5.6.13. (I understand each database is one schema)

I have dump database from MySQL 5.5 and importing to a new schema (i.e. need to change name of database), so same time it is required to implement individual timezones for individual databases.

Please some one could guide to overcome this problem with best solution, which also should be server resource friendly.

Many Thanks.

Questions To Ask Before You Opt For Oracle Directory Services (1 reply)

$
0
0
The ODS is deemed to be a revolutionary product for the next generation business. The service comprises Oracle internet directory, Oracle virtual directory, and Oracle directory server enterprise edition to mold several solutions into one for maximum optimization.

How to connect to Oracle from MySQL (no replies)

$
0
0
1>>How to connect to Oracle from MySQL and
2>>How to connect to SQL Server from MySQL

In the past I used the reverse > linked server many times, MySQL source and Destination Sql serevr/ Oracle.
But now i need to access SQL server/ Oracle from MySQL side, i spent a day and couldn't get it. Help requested.

Thanks

mobile devices for monitoring and administrating RDBMS (no replies)

$
0
0
Dear database experts,

my name is Anna and I’m a comp-sci student from Germany, currently in the process of writing my Bachelor’s Thesis on the use of mobile devices for monitoring and administrating RDBMS. I’m conducting a survey among database experts to get a better feel for what DBAs are already using today, what they’d like to use in the future and what devices and operating systems are most revalent among DBAs.

If you are currently a DBA, I would be absolutely thrilled if you could spare 5 minutes to complete the following survey! https://docs.google.com/forms/d/1Q2d5cfLvD4TvCa979Sho1ro8seYll_AxA7W1pX1aUgk/viewform

The survey is of course completely anonymous!

Many thanks in advance and warm regards,
Anna

Losing connection when querying the database (no replies)

$
0
0
Hi,

I have a MySQL 5.5 server installed on a Windows Server 2008 R2 64-bit host with 6 GB of RAM. I only have two databases on here, one is approximately 1 GB large and the other one is around 4.5 GB large.
I'm having trouble with the larger one and I can't seem to do a consistency check on it properly.

I run: mysqlcheck.exe -u root -p db_name

And after about 15 minutes I get this error message:
C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqlcheck.exe: Got error: 2013: Lost connection to MySQL server during query when executing 'CHECK TABLE ... '

Also when I try to dump the database with this command:
mysqldump.exe -u root -p db_name > db_name.sql

I get this:
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `tablename` at row: 17457397

At some points MySQL has crashed and I've been forced to start it up again.
When I executed this command on the server:
mysql> SHOW ENGINE INNODB STATUS;

I get this:

=====================================
140109 14:32:10 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 3 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 78 1_second, 78 sleeps, 7 10_second, 8 background, 8 flush
srv_master_thread log flush and writes: 78
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 7, signal count 7
Mutex spin waits 5, rounds 34, OS waits 0
RW-shared spins 7, rounds 210, OS waits 7
RW-excl spins 0, rounds 0, OS waits 0
Spin rounds per wait: 6.80 mutex, 30.00 RW-shared, 0.00 RW-excl
------------
TRANSACTIONS
------------
Trx id counter AC7625C
Purge done for trx's n:o < AC3ED01 undo n:o < 0
History list length 122
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started, OS thread id 8812
MySQL thread id 111, query id 1311 localhost ::1 root
SHOW ENGINE INNODB STATUS
---TRANSACTION AC7625B, not started, OS thread id 9164
MySQL thread id 144, query id 1310 localhost 127.0.0.1 name
---TRANSACTION AC7623C, not started, OS thread id 7932
MySQL thread id 142, query id 1263 localhost 127.0.0.1 name
---TRANSACTION AC7623B, not started, OS thread id 10156
MySQL thread id 133, query id 1204 localhost 127.0.0.1 name
---TRANSACTION AC7621C, not started, OS thread id 9872
MySQL thread id 131, query id 1157 localhost 127.0.0.1 name
---TRANSACTION AC7621B, not started, OS thread id 9376
MySQL thread id 122, query id 1098 localhost 127.0.0.1 name
---TRANSACTION AC761FC, not started, OS thread id 7156
MySQL thread id 120, query id 1051 localhost 127.0.0.1 name
---TRANSACTION AC761FB, not started, OS thread id 9820
MySQL thread id 102, query id 963 localhost 127.0.0.1 name
---TRANSACTION AC761CB, not started, OS thread id 6068
MySQL thread id 83, query id 753 localhost 127.0.0.1 name
--------
FILE I/O
--------
I/O thread 0 state: wait Windows aio (insert buffer thread)
I/O thread 1 state: wait Windows aio (log thread)
I/O thread 2 state: wait Windows aio (read thread)
I/O thread 3 state: wait Windows aio (read thread)
I/O thread 4 state: wait Windows aio (read thread)
I/O thread 5 state: wait Windows aio (read thread)
I/O thread 6 state: wait Windows aio (write thread)
I/O thread 7 state: wait Windows aio (write thread)
I/O thread 8 state: wait Windows aio (write thread)
I/O thread 9 state: wait Windows aio (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
2316 OS file reads, 11 OS file writes, 11 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 5, seg size 7, 0 merges
merged operations:
insert 0, delete mark 0, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 1166359, node heap has 1 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 16199340211952
Log flushed up to 16199340211952
Last checkpoint at 16199340211952
0 pending log writes, 0 pending chkp writes
12 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 603111424; in additional pool allocated 0
Dictionary memory allocated 162587
Buffer pool size 35968
Free buffers 33790
Database pages 2177
Old database pages 823
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 2177, created 0, written 2
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s
LRU len: 2177, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread id 6016, state: waiting for server activity
Number of rows inserted 0, updated 0, deleted 0, read 145002
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================


And lastly this is my config.
my.ini:

[client]
port=3306

[mysql]
default-character-set=latin1

[mysqld]
port=3306
basedir="C:/Program Files/MySQL/MySQL Server 5.5/"
datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"
character-set-server=latin1
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=100
query_cache_size=186M
table_cache=1520
tmp_table_size=67M
thread_cache_size=38

myisam_max_sort_file_size=100G
myisam_sort_buffer_size=67M
key_buffer_size=29M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K

innodb_data_home_dir="E:/MySQL Datafiles/"
innodb_additional_mem_pool_size=23M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size = 11M
innodb_buffer_pool_size = 562M
innodb_log_file_size = 214M
innodb_thread_concurrency=8


log-output = FILE
general_log_file = mysql_general_log_new.log
log-error = "E:/MysqlLogerrors/err.log"


I wasn't the on who installed this and the person who did isn't working here anymore so I can't consult him and MySQL is not really my cup of tea.
Is there anyone who can help me here? What's the problem? Is it MySQL or is it the OS/hardware?
Anything that can help me here is appreciated. If you need more info just tell me.

thanks,
-Patric

How to limit temporary table file size? (1 reply)

$
0
0
Hi,

sometimes my clients run stupid queries, which create huge temporary tables. Sometimes, they use all available space (100+ Gb). And block all queries from other clients (no space left).

I want to limit max file size for temporary table (or rows) to ~10Gb.

Is there a solution for that?

Maybe there are solution on OS level?

I am running 5.5.31 on Linux.

error while mysql dump (1 reply)

$
0
0
Hello,

Below error is coming after executing mysqldump command.Please assist.

amdc-mysql-lx01:/mysql-backups$ mysqldump -u admin-dm -ptre2 aso7_prod>dump_aso7prod_2112014.sql
mysqldump: Got error: 1045: Access denied for user 'admin-dm'@'localhost' (using password: YES) when trying to connect



Best regards,
Vishal
Viewing all 812 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>