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

Mysql 5.7 at Centos 7 : how to use systemctl for non-unix-root account ? (no replies)

$
0
0
I learned that in Centos 7 the well known (and recommended) command mysqld_safe doesn't exist anymore. And that the systemctl (from systemd) shall be used instead.

The matter is that i, as dba, don't have acces to unix root account. Therefore, can't use systemctl to stop/start mysqld...

So, what's the proper way for non-unix-root account to stop/start mysqld ?

Many thanks in advance,
Avi

Help! 15 users causing 100% CPU Usage by MySQL 5.7 in Windows 2012 R2 (1 reply)

$
0
0
Greetings,

I am having some issues with our MySQL deployment and it seems to be coming to a head. Our MYSQL deployment has always been a hog! And the CPU runs at 100%. It seems to have only got worse after a move to a new server.

I am running MYSQL 5.7 on a VMWare ESXI 6.5 host.

VM Specs:
64 bit
4 CPU @ Xeon E5-2450 v2 @ 2.5Ghz
8GB Ram

I started out as 2 CPU, and it wouldn't even run. I upped it to 4 CPU, and it would at least get off the ground. However it's slow and pegging CPU resources at 100%. I have posted my.ini at the end of this post. My deployment is just servicing about 15 users on a homebrew ticketing application so I can't for the life of me figure out why this thing is eating up so much resources.

Would you please review my ini and offer any recommendations? If you need any other information to help me troubleshoot, lay it on me.

Thanks in Advance for any help!
-ben

[client]
port=3306
[mysql]
no-beep
default-character-set=utf8
[mysqld]
port=3306
datadir=C:/ProgramData/MySQL/MySQL Server 5.7\Data
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-output=FILE
general-log=0
general_log_file="TMSRV.log"
slow-query-log=1
slow_query_log_file="TMSRV-slow.log"
long_query_time=10
log-error="TMSRV.err"
server-id=1
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads"
max_connections=200
query_cache_size=512M
table_open_cache=2000
tmp_table_size=252M
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=24M
key_buffer_size=25M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=3G
innodb_log_file_size=48M
innodb_thread_concurrency=0
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=100M
max_connect_errors=100
open_files_limit=4161
query_cache_type=0
sort_buffer_size=5M
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000

Dumping a v4 database (1 reply)

$
0
0
A remote shared host has what apparently is a version 4 MySQL database that is used by a legacy CMS. I'm attempting to relocate the CMS and need to dump the database. The host provides phpmyadmin but it fails to dump the database. Attempting mysqldump from the shell also fails. The host's support has replied that neither phpmyadmin or mysqldump can export or dump the db due to its ancient version.

I do not know how restrictive the privileges are but I do know the db resides on a host other than the CMS. On the off chance that the privileges have a wildcard I'd like to try to create a dump with some legacy MySQL tool. What tool is recommended?

Error Message: "Got an error reading communication packets" (1 reply)

$
0
0
Hello folks,

the MySQL database server on my server is constantly generating errors.
Here is a section out of the error log

=====
170607 8:48:01 [Warning] Aborted connection 13351 to db: 'db' user: 'dbUser' host: 'HostName' (Got an error reading communication packets)
170607 8:48:46 [Warning] Aborted connection 13353 to db: 'db' user: 'dbUser' host: 'HostName' (Got an error reading communication packets)
170607 8:48:46 [Warning] Aborted connection 13352 to db: 'db' user: 'dbUser' host: 'HostName' (Got an error reading communication packets)
170607 8:52:11 [Warning] Aborted connection 13355 to db: 'db' user: 'dbUser' host: 'HostName' (Got an error reading communication packets)
170607 8:56:23 [Warning] Aborted connection 13360 to db: 'db' user: 'dbUser' host: 'HostName' (Got an error reading communication packets)
=====

So I googled for a solution and I ended up in increasing the value of the server variable 'max_allowed_packet'.
I already increased this variable to the maximum value of 1073741824 and restartet the server, but it didn't change anything. The error message gets still written to the log file.

The server is MySQL 5.1.24 and the OS of the server is Windows Server 2008.

Hope you can help me with that, since I have no idea why the message is still logged into the file.

Thanks
Kind Regards
Mar K

Access issues for MySQL database on OS X (1 reply)

$
0
0
When I upgraded from OS X Mavericks to OS X Yosemite the MySQL user database seem to have been changed. I have now only one user administrator@localhost. This is the login Mac user. There is no root user in the database. If I do this query:

>SELECT current_user();

I get

''@localhost

So I am logged on to MySQL as blank. Blank has no privileges to create a root user or to grant privileges.

Given this, how do I re-create a root user in the database. I would have to give privileges to blank but cannot while logged on as blank. Alternatively, I should log on as administrator. But I did not create this user in the database and do not know the password.

The database folder has the data from before the migration. All I want to do is extract a file with the database content in the form of a query that I could load somewhere else.

Being able to re-create the root user would get me on the right path.

Thanks for your help. Point me to the right forum if necessary.

ERROR 1146 (42S02) Table 'DataBase.MyTable' doesn't exist. (no replies)

$
0
0
Hi

I try to restore mysql Database. First create the DataBase using:

mysqladmin -u user -p create DataBase

It's Run OK and create the DataBase, BUT when i restore the Database:

mysql -u user -p DataBase < MyFile.sql

Show a message like:


ERROR 1146 (42S02) Table 'DataBase.MyTable' doesn't exist.

Note.- SO Linux Centos realease 6.9 & MySQL 5.1.73-log in the both servers.

Can somebody help me?
THANKS

Does --single-transaction apply to all db'es being dumped with mysqldump? (no replies)

$
0
0
I have 3 databases which need to be kept in sync. They are on the same db server/mysql instance

At the moment I do a mysqldump with :

--databases db1 db2 db3 --quick --single-transaction

Someone has said that the single-transaction will only apply to one of the databases at a time (& the tables within) ergo the 3 databases might get out of sync during the dump. The only vague references I can find to this are:

https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_databases
"--all-databases, -A
Dump all tables in all databases. This is the same as using the --databases option and naming all the databases on the command line."

&

"--single-transaction
This option sets the transaction isolation mode to REPEATABLE READ and sends a START TRANSACTION SQL statement to the server before dumping data. It is useful only with transactional tables such as InnoDB, because then it dumps the consistent state of the database at the time when START TRANSACTION was issued without blocking any applications."

so in situation like this is the single transaction applicable to all 3 databases in the list or just the tables within a single database and thus ggiven the time taken to dump the 3 databases might be out of sync?

If the latter then is there any known solution to dumping multiple db'es within a single transaction?

TIA

Importing 3GB mysqldump on 32-bit system? (3 replies)

$
0
0
I am trying to import a large mysqldump file (>3GB) created on a 64-bit Windows 10 machine (x64; MySQL Server 5.6.35) to a 32-bit Linux system (armv71; MySQL Server 5.1.56). I am getting the following error:

ERROR: Can't initialize batch_readline - may be the input source is a directory or a block device.

The isue seems to be that 32-bit tools cannot open files >2GB.

Is it possible to import a >2GB mysqldump file on a 32-bit system? Any help is greatly appreciated.

MYSQL CRASHING FREQUENTLY (no replies)

$
0
0
Hi!
I am using mysql 5.6. on centos 7.3.

SERVER CONFIGURATIONS

Server configuration :
CPU xeon e5 2697A dual socket.
RAM 1.5 TB total 64 GB x24 DDR4 2133Mhz.
HDD 8 HDD 8TB each 12 Gbps NLSas 7.2 RPM.
NIC 10Gbps DA/SFP+ QLOGIC.
OS Centos 7 64 bit.
RAID 10 is being used.
CPU is multi-threaded


DATABASE Configuration File is

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
#innodb---------
innodb_buffer_pool_size=962072674304
innodb_buffer_pool_instances=16
innodb_log_file_size=2147483648
innodb_sort_buffer_size=67108864
innodb_change_buffering=all
innodb_change_buffer_max_size=35
innodb_log_buffer_size=134217728
#innodb Disk I/O-----
innodb_doublewrite=OFF
innodb_flush_log_at_trx_commit=1
innodb_read_io_threads=64
innodb_write_io_threads=64
innodb_io_capacity=5000
innodb_file_per_table=ON
#Recovery----
innodb_force_recovery=0
slow_launch_time=2
#general_Variables
query_cache_size=53687091200
max_heap_table_size=2560000
thread_cache_size=16384
query_cache_type=1
max_allowed_packet=1073741824
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
#logs
expire_logs_days=7
log-bin=/var/lib/mysql/bin-log
log-bin-index=/var/lib/mysql/bin-log.index
max_binlog_size=1073741824
binlog_format=row
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysqlerr.log
pid-file=/var/run/mysqld/mysqld.pid





Everyday We are running bulk insert of approximate 2 Billion rows into 4 different tables.
Tables are partitioned (RANGE PARTITION) on daily basis with INNODB storage engine.

Everyday mysql is crashing. Error log


170622 04:31:33 mysqld_safe Number of processes running now: 0
170622 04:31:33 mysqld_safe mysqld restarted
2017-06-22 04:31:33 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-06-22 04:31:33 0 [Note] /usr/sbin/mysqld (mysqld 5.6.35-log) starting as process 126830 ...
2017-06-22 04:31:33 126830 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2017-06-22 04:31:33 126830 [Warning] Buffered warning: Changed limits: table_open_cache: 431 (requested 2000)

2017-06-22 04:31:33 126830 [Note] Plugin 'FEDERATED' is disabled.
2017-06-22 04:31:33 126830 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-06-22 04:31:33 126830 [Note] InnoDB: The InnoDB memory heap is disabled
2017-06-22 04:31:33 126830 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-06-22 04:31:33 126830 [Note] InnoDB: Memory barrier is not used
2017-06-22 04:31:33 126830 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-06-22 04:31:33 126830 [Note] InnoDB: Using Linux native AIO
2017-06-22 04:31:33 126830 [Note] InnoDB: Using CPU crc32 instructions
2017-06-22 04:31:33 126830 [Note] InnoDB: Initializing buffer pool, size = 896.0G
2017-06-22 04:32:12 126830 [Note] InnoDB: Completed initialization of buffer pool
2017-06-22 04:32:17 126830 [Note] InnoDB: Highest supported file format is Barracuda.
2017-06-22 04:32:17 126830 [Note] InnoDB: The log sequence numbers 7138674160333 and 7138674160333 in ibdata files do not match the log sequence number 7252262735448 in the ib_logfiles!
2017-06-22 04:32:17 126830 [Note] InnoDB: Database was not shutdown normally!
2017-06-22 04:32:17 126830 [Note] InnoDB: Starting crash recovery.
2017-06-22 04:32:17 126830 [Note] InnoDB: Reading tablespace information from the .ibd files...
2017-06-22 04:32:21 126830 [Note] InnoDB: Restoring possible half-written data pages
2017-06-22 04:32:21 126830 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Last MySQL binlog file position 0 731118539, file name bin-log.001003
2017-06-22 04:32:33 126830 [Note] InnoDB: 128 rollback segment(s) are active.
2017-06-22 04:32:33 126830 [Note] InnoDB: Waiting for purge to start
2017-06-22 04:32:33 126830 [Note] InnoDB: 5.6.35 started; log sequence number 7252262735448
2017-06-22 04:32:33 126830 [Note] Recovering after a crash using /var/lib/mysql/bin-log
2017-06-22 04:32:34 126830 [Note] Starting crash recovery...
2017-06-22 04:32:34 126830 [Note] Crash recovery finished.
2017-06-22 04:32:36 126830 [Note] Server hostname (bind-address): '*'; port: 3306
2017-06-22 04:32:36 126830 [Note] IPv6 is available.
2017-06-22 04:32:36 126830 [Note] - '::' resolves to '::';
2017-06-22 04:32:36 126830 [Note] Server socket created on IP: '::'.
2017-06-22 04:32:36 126830 [Note] Event Scheduler: Loaded 0 events
2017-06-22 04:32:36 126830 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.35-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2017-06-22 04:32:36 126830 [Warning] IP address '10.101.10.72' could not be resolved: Name or service not known
2017-06-22 04:32:36 126830 [Warning] IP address '10.101.124.87' could not be resolved: Name or service not known
2017-06-22 09:23:47 126830 [Warning] IP address '10.101.10.90' could not be resolved: Name or service not known
2017-06-22 09:31:39 126830 [Warning] IP address '10.101.124.58' could not be resolved: Name or service not known
2017-06-22 09:42:49 126830 [Warning] IP address '10.101.124.66' could not be resolved: Name or service not known
170622 09:46:15 mysqld_safe Number of processes running now: 0
170622 09:46:15 mysqld_safe mysqld restarted
2017-06-22 09:46:16 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-06-22 09:46:16 0 [Note] /usr/sbin/mysqld (mysqld 5.6.35-log) starting as process 130365 ...
2017-06-22 09:46:16 130365 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2017-06-22 09:46:16 130365 [Warning] Buffered warning: Changed limits: table_open_cache: 431 (requested 2000)

2017-06-22 09:46:16 130365 [Note] Plugin 'FEDERATED' is disabled.
2017-06-22 09:46:16 130365 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-06-22 09:46:16 130365 [Note] InnoDB: The InnoDB memory heap is disabled
2017-06-22 09:46:16 130365 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-06-22 09:46:16 130365 [Note] InnoDB: Memory barrier is not used
2017-06-22 09:46:16 130365 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-06-22 09:46:16 130365 [Note] InnoDB: Using Linux native AIO
2017-06-22 09:46:16 130365 [Note] InnoDB: Using CPU crc32 instructions
2017-06-22 09:46:16 130365 [Note] InnoDB: Initializing buffer pool, size = 896.0G
2017-06-22 09:46:51 130365 [Note] InnoDB: Completed initialization of buffer pool
2017-06-22 09:46:56 130365 [Note] InnoDB: Highest supported file format is Barracuda.
2017-06-22 09:46:56 130365 [Note] InnoDB: The log sequence numbers 7138674160333 and 7138674160333 in ibdata files do not match the log sequence number 7254914115945 in the ib_logfiles!
2017-06-22 09:46:56 130365 [Note] InnoDB: Database was not shutdown normally!
2017-06-22 09:46:56 130365 [Note] InnoDB: Starting crash recovery.
2017-06-22 09:46:56 130365 [Note] InnoDB: Reading tablespace information from the .ibd files...
2017-06-22 09:47:00 130365 [Note] InnoDB: Restoring possible half-written data pages
2017-06-22 09:47:00 130365 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Last MySQL binlog file position 0 732905726, file name bin-log.001004
2017-06-22 09:47:12 130365 [Note] InnoDB: 128 rollback segment(s) are active.
2017-06-22 09:47:12 130365 [Note] InnoDB: Waiting for purge to start
2017-06-22 09:47:12 130365 [Note] InnoDB: 5.6.35 started; log sequence number 7254914115945
2017-06-22 09:47:12 130365 [Note] Recovering after a crash using /var/lib/mysql/bin-log
2017-06-22 09:47:13 130365 [Note] Starting crash recovery...
2017-06-22 09:47:13 130365 [Note] Crash recovery finished.
2017-06-22 09:47:15 130365 [Note] Server hostname (bind-address): '*'; port: 3306
2017-06-22 09:47:15 130365 [Note] IPv6 is available.
2017-06-22 09:47:15 130365 [Note] - '::' resolves to '::';
2017-06-22 09:47:15 130365 [Note] Server socket created on IP: '::'.
2017-06-22 09:47:15 130365 [Note] Event Scheduler: Loaded 0 events
2017-06-22 09:47:15 130365 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.35-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2017-06-22 09:47:15 130365 [Warning] IP address '10.101.124.87' could not be resolved: Name or service not known
2017-06-22 09:47:15 130365 [Warning] IP address '10.101.10.72' could not be resolved: Name or service not known
2017-06-22 09:47:15 130365 [Warning] IP address '10.101.10.72' could not be resolved: Name or service not known
2017-06-22 09:50:20 130365 [Warning] IP address '10.101.124.66' could not be resolved: Name or service not known

Failed to write to mysql.slow_log: Thread stack overrun (no replies)

$
0
0
I am seeing quite a lot of the following errors in the alert log.

2017-06-27 22:31:14 42732 [ERROR] Failed to write to mysql.slow_log: Thread stack overrun: 116582671296 bytes used of a 262144 byte stack, and 81920 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.
2017-06-27 22:31:14 42732 [ERROR] Failed to write to mysql.slow_log: Thread stack overrun: -8879168 bytes used of a 262144 byte stack, and 81920 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.


* This error only appears in on production DB instance.
* This is an Amazon Aurora (5.6.10) Mysql instance configured as an 8xlarge (32 vCPU, 244G RAM).

1. The documentation on this parameter (thread_stack) is sparse and only mentions default values for 32 vs 64 bit hosts. This is set to the default of 256G [1]
2. I can find only a few references in blogs and forums that discuss this parameter. Most just recommend setting to the default. There is no discussion on effects (negative or positive) about adjusting this value.
3. There is absolutely no mention about a negative thread stack overrun. What does that mean?
4. Other then giving each thread/connection use a bit more memory, what other things should I consider when increasing this parameter?
5. should I increase just the 80K recommended in the error? or increase to something a bit larger?
6. the default is 256KB but the overrun above is 108.5GB but is asking for an 80K increase. I'm confused.

Any ideas?



Thanks
Eric

[1] https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_thread_stack

Weird behavior after deleting (!) accounts (no replies)

$
0
0
There were quite a few accounts on our MySQL database that started with (!). The explanation was "<account> does not exist but it still has privileges defined for the following objects:” Based on the information given and another post in the forum that said "The message you get comes from the fact that there are grants for a user which no longer exists. So it makes sense to remove those grants.” However, when I removed the account, it affected an active user (another account) by removing the grants for that user. The two accounts (the deleted one and the active one) had the same name but were different accounts from two different hosts. Has anyone seen this behavior before?

Mysql upgrade to 5.7 with MyISAM (no replies)

$
0
0
Hi,

I have a 5.5 mysql on linux and am planning to upgrade to 5.7. I understand that I need to upgrade in steps from 5.5 to 5.6 and then to 5.7. I have a few MyISAM tables in the 5.5 instance and I also want to move them to InnoDb. Should I convert these tables to InnoDB in 5.5 before the upgrade to 5.6 and 5.7 or should I leave them alone and convert them only in 5.7. Is there a preferred way?

thanks,

benny

Count number of open cursors (no replies)

$
0
0
Is there a way to count the number of open cursors in MYSQL(and also list the corresponding sql)?

I can do this in Oracle, can I do it in MYSQL?

Delete job caused tables to grow larger in slaves (1 reply)

$
0
0
Hello all,

I have a question. I have a replicated environment. One master and two readonly slaves. I have a few large partitioned table about 60GB. Today I found the table in slave is much larger than the master. I ran a query to check the data size,index size and fragmentation. The data size is much larger in slaves. The second slave which we built recently didn't experience the same we have in the first slave. That indicates there must be some fragmentation. But I don't understand why. Could someone explain what might have occurred? I need to confirm with our developer whether we have a delete job for this table but he is OOO today. Could the delete batch job caused the slave table to grow in size? The replication is doing row based replication and we are running on version 5.5. All tables are in InnoDB format.

I need some suggestion. Any input is truly appreciated.

benny



Master
====

+----------------+------------+-------------+--------------+-----------+------------+
| PARTITION_NAME | TABLE_ROWS | data_length | index_length | data_free | frag_ratio |
+----------------+------------+-------------+--------------+-----------+------------+
| m01 | 0 | 0 | 0 | 0 | 0.0000 |
| m02 | 0 | 0 | 0 | 0 | 0.0000 |
| m03 | 0 | 0 | 0 | 0 | 0.0000 |
| m04 | 6385619 | 1483 | 738 | 0 | 0.0000 |
| m05 | 163694900 | 39429 | 19463 | 0 | 0.0000 |
| m06 | 0 | 0 | 0 | 0 | 0.0000 |
| m07 | 0 | 0 | 0 | 0 | 0.0000 |
| m08 | 0 | 0 | 0 | 0 | 0.0000 |
| m09 | 0 | 0 | 0 | 0 | 0.0000 |
| m10 | 0 | 0 | 0 | 0 | 0.0000 |
| m11 | 0 | 0 | 0 | 0 | 0.0000 |
| m12 | 0 | 0 | 0 | 0 | 0.0000 |
+----------------+------------+-------------+--------------+-----------+------------+


Slave
====

+----------------+------------+-------------+--------------+-----------+------------+
| PARTITION_NAME | TABLE_ROWS | data_length | index_length | data_free | frag_ratio |
+----------------+------------+-------------+--------------+-----------+------------+
| m01 | 0 | 0 | 0 | 0 | 0.0000 |
| m02 | 0 | 0 | 0 | 0 | 0.0000 |
| m03 | 0 | 0 | 0 | 0 | 0.0000 |
| m04 | 5695472 | 1484 | 738 | 5 | 0.0023 |
| m05 | 156336301 | 43878 | 19601 | 5 | 0.0001 |
| m06 | 0 | 0 | 0 | 0 | 0.0000 |
| m07 | 0 | 0 | 0 | 0 | 0.0000 |
| m08 | 0 | 0 | 0 | 0 | 0.0000 |
| m09 | 0 | 0 | 0 | 0 | 0.0000 |
| m10 | 0 | 0 | 0 | 0 | 0.0000 |
| m11 | 0 | 0 | 0 | 0 | 0.0000 |
| m12 | 0 | 0 | 0 | 0 | 0.0000 |
+----------------+------------+-------------+--------------+-----------+------------+


benny

mysqld is not recognised as an internal or external command, operable (no replies)

$
0
0
Hi expert,

I lost my password and need to reset it.

Tried using powerShell as well as cmd to do it but then I got the above message.

The steps that I tried to follow are as follows :

reference : https://dev.mysql.co...ns-windows.html

C:\> cd "C:\Program Files\MySQL\MySQL Server 5.7\bin"
C:\> mysqld --init-file=C:\\mysql-init.txt

After I finished the second line, it just gave me the error :
mysqld is not recognised as an internal or external command, operable

Hope someone can help me out cos I have been trying the entire night....

Lock timeout exceed: explaination (no replies)

$
0
0
Hello all,

I have identified a transaction when it reported a Lock timeout exceeded error. I can only gather some information from the slow query log and the query developer ran. (I am unable to see much detail in show engine innodb status since it was overwritten by other deadlock information)

The query our developer ran was an insert statement to a tableA. I found in the same period (3 minutes) there was a couple of long update statements to tableA doing a full table scan. I don't know the order of the transactions. But the insert statement was kicked out with the error message.

e.g.

update tableA set colx=1 where colY=2;
update tableA set colx=1 where colY=2;
insert into tableA values (...)


There is no index on colY so it is a full table scan. The insert statement experienced a lock time error message.

I want to know why the insert statement got kicked out? I can't seem to explain this. There was a primary key in the table and also a couple of foreign keys on tableA.

Could someone help me piece them together and explain what might have caused this? perhaps a workaround to avoid this?

Your input is appreciated.

thank you

benny

way to determine when query run (no replies)

$
0
0
Just wonder if anyone knows a way to determine the last time a user query is ran? I am using mysql workbench and looking at high costs SQL statements but cannot see when they were ran last.

GRANTS using general and specific permissions (no replies)

$
0
0
I came across with something in permissions and can't know if it's the expected behaviour or there's something missing:
If I give an user GRANT SELECT on wild card schema like "schema_%" and then I give him INSERT and UPDATE in specifig schema like schema like "schema_user", I get some errors. More detailed situation:

When I start, the user has this GRANTS:

+----------------------------------------------------------------------------------------------------------------+
| Grants for user@% |
+----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'user'@'%' IDENTIFIED BY PASSWORD '*XXXXXXXXXXXXXXXXXXXXXX' |
| GRANT SELECT ON `schema_%`.* TO 'user'@'%'; |
| GRANT SELECT, INSERT, UPDATE, DELETE ON `schema_user`.* TO 'user'@'%' |
+----------------------------------------------------------------------------------------------------------------+



And if I issue a UPDATE I get an error:

mysql> UPDATE schema_user.table SET field='some_text';
ERROR 1142 (42000): UPDATE command denied to user 'user'@'X.X.X.X' for table 'table'

BUT if I REVOKE and GRANT the general permissions:

mysql> REVOKE SELECT ON `schema_%`.* FROM user;
mysql> GRANT SELECT ON `schema_%`.* TO user;

And check the GRANTS again, the order changed:


+----------------------------------------------------------------------------------------------------------------+
| Grants for user@% |
+----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'user'@'%' IDENTIFIED BY PASSWORD '*XXXXXXXXXXXXXXXXXXXXXX' |
| GRANT SELECT, INSERT, UPDATE, DELETE ON `schema_user`.* TO 'user'@'%' |
| GRANT SELECT ON `schema_%`.* TO 'user'@'%'; |
+----------------------------------------------------------------------------------------------------------------+


And now the UPDATE works fine:

mysql> UPDATE schema_user.table SET field='some_text';
Query OK, 0 rows affected (0.09 sec)







This is happening with MySQL Community Server 5.6.36 in Centos 7.3.1611


Here's the steps that can lead to replicate my situation:


As root:

CREATE DATABASE demo_priv;
CREATE TABLE demo_priv.tbl (id INT(5) NOT NULL AUTO_INCREMENT PRIMARY KEY, some_text VARCHAR(50));
INSERT INTO demo_priv.tbl(some_text) VALUES ('insert');
CREATE USER test IDENTIFIED BY 'Password';
GRANT SELECT ON `demo_%`.* TO test;
GRANT INSERT, SELECT, UPDATE ON demo_priv.* TO test;
FLUSH PRIVILEGES;
SHOW GRANTS FOR test;

As "test":

UPDATE demo_priv.tbl SET some_text='update';
ERROR 1142 (42000): UPDATE command denied to user 'test'@'X.X.X.X' for table 'tbl'

As root:

REVOKE SELECT ON `demo_%`.* FROM test;
GRANT SELECT ON `demo_%`.* TO test;

And then you should be able to UPDATE.




I was going to issue this as a bug; but I don't know if I'm wrong and this is the expected behaviour; I think MySQL should do something like "merge" all the GRANTS involving, and looks like it's getting the first permission (the SELECT) required and stops looking for more (INSERT, SELECT, UPDATE later).
Hope anyone can help me.

MySQL administrat and minimizing issue (no replies)

$
0
0
Hi,

I am new user for application, tying to understand the feature and how to use to make simple mysql administration.

Had develop a script, checking User connection, CPU and Memory Utilization, Partition Size, Slow Query and Repair Corrupted Table.
Script output is check parameter and threshold breach details.

Want to know, can we using this application and minimize User connection if breached 80%, CPU and Memory Utilization breached 80%, Partition Size breached 80%, Slow Query effect.

Mysql 5.7.17 crashes on Update query (no replies)

$
0
0
Hi GUys,

I have MYSQL 5.7.17 installed on Windows server 2012 R2.

Workbench 6.3.8

When I run the below query the MYSQL.exe on the server crashes:

UPDATE `kpi`.`bed_board` SET `BED_STATUS`='VACANT' WHERE `SR_NO`='22'.

The log do not give any information please see below the last lines of the logs when mysql crashed.


11:15:31 UPDATE `kpi`.`bed_board` SET `BED_STATUS`='VACANT' WHERE `SR_NO`='22' Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.296 sec

Regards,
RVS
Viewing all 812 articles
Browse latest View live