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

database size (1 reply)

$
0
0
Hi,

I have database running on MYSQL the TOTAL database size is currently restricted to 9GB but the 9GB has already filled up is there a way i can increase its capacity to more than 9GB or set it to limitless.
Kindly advice

MySQL running on Windows system and large_pages (no replies)

$
0
0
Hi guys

My target is to configure large pages on Windows to be userd by MySQL engine
Searching on MySQL documentation, I just found who to do it on *nix, but no word for Windows

Someone has any suggestion?

Thanks in advance

SQL statement logging (no replies)

$
0
0
Hi. Apologies in advance for my shear lack of knowledge on MySQL.
I would be very grateful on any advice on logging SQL statements.
I've tried to read the info at https://dev.mysql.com/doc/refman/5.7/en/server-logs.html
First of all do these logs show up statements that are executed on the database? Say for instance, can I use these logs to monitor if someone is able to do some sql injection? Would the logs show someone who's managed to execute a statement to delete all tables?

I think I'll leave the questioning there for now. I did warn you in advance of my shear lack of knowledge :)

MYSQL DB Creation is slow because of TABLE_SCHEMA table (1 reply)

$
0
0
Hello There,

We are maintaining a SaaS-based system for which we have to create MySQL database runtime and also we have to destroy the same.

Right now our DB creation has become very very slow and after investigating we found 2 places are not cleaning up the data after dropping the database.


1) mysql.db table, Here I found few of the entries which are not removed but the physical database is removed.

2) information_schema.SCHEMA_PRIVILEGES
I can see there are 17,247,262 records in this table but out of which 12,909,078 records are from the dropped databases.

I suspect because of this many records in the information_schema.SCHEMA_PRIVILEGES the overall process of DB creation has become slow.

Please let me know how can I clean up the data from information_schema.SCHEMA_PRIVILEGES .

If you have any other thought then please do share.


Regards,
Nilay Mehta
Technical Architect
HiddenBrains.com

How to connect to a MYSQL in local machine from the Cloud? (2 replies)

$
0
0
[ Customer PC - MYSQL DB ] <--cloud--- [ Web App ]
[ Customer PC - MYSQL DB (master) ] <--cloud--- [ MYSQL DB (slave) | Web App ]

I have a mysql database that resides in a normal pc (windows 7), it's a database from an old application and I can't move it.

I need to communicate a web app (that resides in the cloud) with the database inside the "normal windows 7" that resides in a local lan with a private IP.

I was trying to do a MYSQL replication between the local database and a mysql slave, I do my test using virtual machine and it was working.

But when I try to replicate it, I realize that I can't do NAT between a normal windows and the public IP of my client and therefore I can't get the connection between the local MYSQL (master) and the Slave (Cloud) to get the replication.

Maybe there is something that I'm missing?

How to synchronise MySQL's time without mysql restart? (1 reply)

$
0
0
I don't know if it is possible:

On my machine I have a service to synchronise the SYSTEM time (including Time zone), and I would like the DB will synchronize with the machine clock once in a while.

When I change SYSTEM time, MySQL keep giving the old time when I use CURRENT_TIMESTAMP, It Synchronise only when I restart the MySQL service.

I would like to ask: is it possible (by update some system variable, or simmilar) to set the DB clock without a restart of the service?

I don't want to stop the DB at all.

I think that maybe a sceduled task, which run once in a while, can be set, but what should it do?


I want somthing like this:

select CURRENT_TIMESTAMP from dual; #--still shows old time

#....put here some update time code

select CURRENT_TIMESTAMP from dual; #--want it to show current time

REVOKE insert/update/delete privileges to lock a table from modification (no replies)

$
0
0
Hello Experts,

I am a software developer and we are going through a major rails application upgrade during which we are locking the entire application to make it read-only. We have done everything except if a user tries to update his profile information, it is getting updated in the MySQL database users table but not in other parts of our application. As I started looking for ways to make a table read-only, I stumbled upon this.

https://stackoverflow.com/questions/3861564/make-a-single-table-in-mysql-read-only

But, it didn't work in my case. Instead, I tried this.

https://github.com/uclibs/scholar_uc/wiki/Make-'users'-table-read-only

Application uses 'jay'@'localhost' user to access database and is the only other user apart from 'root'. When I login to my application and update my profile on the site, it goes through just fine and the users table gets updated even after making the user 'jay' to have only SELECT privileges. I have posted a similar question on dba.stackexchange.com and Rick James did try to help me but I still am in the same spot.

https://dba.stackexchange.com/questions/188368/mysql-why-does-update-query-still-run-with-only-select-privileges-on-a-given-t

Let me know if I'm missing something or help me find a way to make 1 table out of 23 to be read-only during our migration.

Thanks,
Jay

importing backup (2 replies)

$
0
0
I went to phpmyadmin and entered to import tab. so the backup file i upload will automatically replace the current database?

Queries per schema (no replies)

$
0
0
Hi,

Is there any MySQL query or extension for getting queries count per schema statistic?


NOTE:
I read about Percona but it seems a full disto of MySQL while I'm looking for an internal or extension solution for MySQL

problem with mysqldbcopy (1 reply)

$
0
0
mysqldbcopy --source=user:1qaZXsw2@localhost:3306:/var/run/mysqld/mysqld.sock --destination=user:1qaZXsw2@localhost:3306:/var/run/mysqld/mysqld.sock db1:db2
WARNING: Using a password on the command line interface can be insecure.
# Source on localhost: ... connected.
# Destination on localhost: ... connected.
# Copying database db1 renamed as db2
ERROR: Query failed. 1302 (HY000): Conflicting declarations: 'CHARACTER SET DEFAULT' and 'CHARACTER SET latin2'

This error shows me each time regardless of the encoding settings in the database. db1 is a single table base

+----------------+
| Tables_in_db1 |
+----------------+
| db1_table |
+----------------+

select * from db1_table;
+------+
| x |
+------+
| 1 |
+------+
1 row in set (0.00 sec)

SHOW VARIABLES LIKE 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin2 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

when i remove latin2 from config:

WARNING: Using a password on the command line interface can be insecure.
# Source on localhost: ... connected.
# Destination on localhost: ... connected.
# Copying database db1 renamed as db2
ERROR: Query failed. 1302 (HY000): Conflicting declarations: 'CHARACTER SET DEFAULT' and 'CHARACTER SET latin1'

SHOW VARIABLES LIKE 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+


How to fix this problem?

LOAD DATA INFILE ERROR 1172 (42000) (1 reply)

$
0
0
Hi,

I am trying to load a data file into database table


mysql> LOAD DATA INFILE 'SERVER.dmz.reg' replace INTO TABLE ServerIPs FIELDS TERMINATED BY '|' (regip, server);

I got following error

ERROR 1172 (42000): Result consisted of more than one row

If I only load one line of data inside the file. I can do it. Two rows start to throw this error


+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| regip | varchar(15) | NO | PRI | NULL | |
| server | varchar(20) | YES | | NULL | |
| lbip | varchar(15) | YES | | NULL | |
| used | varchar(1) | YES | | NULL | |
| balance | varchar(25) | YES | | NULL | |
| keepalive | varchar(30) | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+

Data file
142.xx.xxx.x|server.dmz
142.xx.xxx.xx|server.dmz

I can load the whole file into the development database, but not the production one.

Can you please help?

Error 1133 (42000) Can't find any matched row in the user table (1 reply)

$
0
0
Hi,

I am getting error 1133 (42000) can't find any matched row in the user table for set password command.

Also, I checked whether username exists and it exists.
I tried the query select usrrname from MySQL.user where user='username';

Please help me out.


Thanks,
Priya

MySQL 5.6. (1 reply)

$
0
0
Thought log_bin_basename was introduced in 5.6.2? Still seeing the version 5.6.37-log does not recognize this as a valid system variable. The "show variables like "log_bin_basename" does show the default value though.

Any idea?

Thanks.

Unable to see the mysql database after Initialization (no replies)

$
0
0
Below are the steps i did to create SQL Node in a NDB cluster. Unable to see mysql and ndbinfo databases. Please let me know how to debug this issue.

$sudo /opt/mysql/server-5.7/bin/mysqld --initialize --user=mysql --datadir=/data/mysql
$ sudo systemctl start mysqld
$ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
$ sudo /opt/mysql/server-5.7/bin/mysqld_safe --skip-grant-tables &
$ mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.17-ndb-7.5.5-cluster-gpl MySQL Cluster Community Server (GPL)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.01 sec)

Mysql using 10GB more in ps aux than in MysqlTuner (no replies)

$
0
0
I've been using MySQL 5.7.20 on Ubuntu 16.04.2 for a while and I've noticed that it currently uses far too much memory than what I would expect. I have around 700 tables which are all **MyISAM**.

I've a 128GB RAM server (which uses the memory to do other stuff) and the MySQL memory usage is around 51GB. Here is what `ps aux | grep mysql` gives me

> mysql 7306 105 41.2 63640784 54426684 ? Ssl Dec06 5272:34 /usr/sbin/mysqld

I would expect to be more around 40GB. When I start MySQLTuner, I get the following

`[--] Physical Memory : 125.8G
[--] Max MySQL memory : 42.4G
[--] Other process memory: 43.8G
[--] Total buffers: 40.2G global + 8.8M per thread (256 max threads)
[--] P_S Max memory usage: 72B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 42.4G (33.68% of installed RAM)
[OK] Maximum possible memory usage: 42.4G (33.67% of installed RAM)
`

This confuses me since it says that the max mysql memory is 42.4GB, whereas when I do my `ps aux` I have almost 10GB more!

Finally here is my mysqld.conf file

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer_size = 36G
max_allowed_packet = 64M
tmp_table_size = 4G
max_heap_table_size = 4G
max_connections = 256
table_open_cache = 16384
bulk_insert_buffer_size = 512M
thread_stack = 192K
thread_cache_size = 8
sort_buffer_size = 8M
myisam_sort_buffer_size = 8M

# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#slow_query_log=1
#slow_query_log_file=/var/log/mysql/slow-query.log
#long_query_time=1
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
[isamchk]
key_buffer_size = 36G
sort_buffer_size = 1G
read_buffer = 4M
write_buffer = 4M

Could you help me understanding where those missing 10GB are coming from, and how can I reclaim them ?

Thanks for your help !

Query causing CPU Spike to 100% after MYSQL upgrade (2 replies)

$
0
0
Greetings!

We recently upgraded the kernel from Ubuntu 4.4.0-92-generic to 4.4.0-103-generic. Together with that, mysql got an upgrade from mysql "5.7.19" to "5.7.20".

Current setup:

mysql Ver 14.14 Distrib 5.7.20

Server:
x86_64, Ubuntu 4.4.0-103-generic
# of CPUs -> 2


Issue:
The query below no longer works (worked OK before the upgrade) and causes the CPU to spike to 100%:

mysql>
mysql> select distinct cast(`subtype_values`.`language_override` as char(500) charset latin1) AS `doc_type`,cast(`cffir`.`value` as char(400) charset latin1) AS `doc_type_code` from (((((`col_xxxyyyzzztracking` `cct` join `col_flexicontent_items_tmp` `cfit`) join `col_flexicontent_fields_item_relations` `cffir`) join `col_flexicontent_fields` `cff`) join `col_flexicontent_types` `cft`) join `aabb_ws_doc_subtype_mapping` `subtype_values`) where ((1 = 1) and (`cfit`.`type_id` = `cft`.`id`) and (`cffir`.`item_id` = `cct`.`item_id`) and (`cffir`.`field_id` = `cff`.`id`) and (convert(`cffir`.`value` using utf8mb4) = `subtype_values`.`subtype_value`) and (`cft`.`name` = ('Document - Product, Processing and Application')));


After the upgrade, this query doesn't complete,and the CPU spikes to 100%.
Temporary fix we have is by replacing the "= ('Document - Product, Processing and Application'" with "like ('Document%Product, Processing and Application'", as below:

mysql>
mysql> select distinct cast(`subtype_values`.`language_override` as char(500) charset latin1) AS `doc_type`,cast(`cffir`.`value` as char(400) charset latin1) AS `doc_type_code` from (((((`col_xxxyyyzzztracking` `cct` join `col_flexicontent_items_tmp` `cfit`) join `col_flexicontent_fields_item_relations` `cffir`) join `col_flexicontent_fields` `cff`) join `col_flexicontent_types` `cft`) join `aabb_ws_doc_subtype_mapping` `subtype_values`) where ((1 = 1) and (`cfit`.`type_id` = `cft`.`id`) and (`cffir`.`item_id` = `cct`.`item_id`) and (`cffir`.`field_id` = `cff`.`id`) and (convert(`cffir`.`value` using utf8mb4) = `subtype_values`.`subtype_value`) and (`cft`.`name` like ('Document%Product, Processing and Application')));
+-----------------------------------+-----------------+
| doc_type | doc_type_code |
+-----------------------------------+-----------------+
| General Information | ProductDocType2 |
| Product Brochure | ProductDocType5 |
| Published Posters | ProductDocType6 |
| Product Process Parameters | ProductDocType3 |
| Published White Papers / Articles | ProductDocType7 |
| Product Application Data | ProductDocType1 |
| Product Process Parameters | ProductDocType4 |
+-----------------------------------+-----------------+
7 rows in set (2.70 sec)

mysql>


Any ideas as to why the "="/ "equal" operator fails to work as before, while the "like" operator works?

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.

Mysql error log empty on windows server (1 reply)

$
0
0
Hi All,

We are facing several issues on mysql database server.
So to look out error we generally check error log first.
But the problem here is , error log file is always empty. Nothing is getting written there.
Whenever log is flushed , the error log file is renamed as err-old and that file is also empty.
Our mysql database version is 5.0.77-community-nt-log MySQL Community Edition (GPL).
Please help to find solution.

Database Tables Have Become Invisible! (1 reply)

$
0
0
I am running MySQL 5.5 (Community) under Linux Mint 17.3. Yesterday I was loading a number of databases in preparation for some cross-database queries. Unfortunately on the last database the system ran out of disc space (my fault as I should have kept a closer eye on things). Anyway after I sorted this out I dropped and reloaded the last database. I can query on this with no problem. However, if I query the others it says the relevant table does not exist. However if I use “Show Table” they appear to be there. WorkBench 6.0 also displays the tables but says they do not exist when I query them. If I check on disc within /var/lib/mysql there is a directory for each database with a .frm and .ibd for each table, which appear to be the appropriate size. Can I retrieve the situation or is it back to square one?

Metldown and Spectre Vulnarabilities - Performance Impact (no replies)

$
0
0
Hello All,

Any one observed performance impact after applying the Kernel remediation patches to fix the meltdown and Spectre vulnarabilities.

Thank you.

Regards,
Sireesha
Viewing all 812 articles
Browse latest View live


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