I updated from Windows 10 to Windows 11. Now I can not alter any table anymore on MySQL Workbench.
I increased the timeout to 600 seconds, but still same error. My DB is quiet empty, so it should be no problem of size.
Do I have to change something in the configuration after updating to Win11 for MySQL Workbench?
I have a Python script, which is using this MySQL-DB to use some entries from this DB, that is still working.
I can not share error code as text, because of no copy-paste-functionality.
EDIT: I add the text a can be seen in the screenshot:
Error: There was an error while applying the SQL script to the database.
Executing:
ALTER TABLE 'map'.
ADD COLUMN `route_location` VARCHAR(45) NULL DEFAULT NULL AFTER `route_event`;
Operation failed: There was an error applying thee SQL script to the database.
ERROR 2013: Lost connection to MySQL server during query
SQL Statement:
ALTER TABLE `map`.`routepoints`
ADD COLUMN `route_location` VARCHAR(45) NULL DEFAULT NULL AFTER `route_event`
I tried it with SQL-Script and also with GUI.
After restarting MySQL-Workbench and several times of trying to rerun the SQL-Script it creates the column in the table. Since then I have no problem and its working properly, even if I add a new column.
I'm trying to containerize an app so I'm trying to write an init file for a MariaDB database for an existing database that exists on a remote server. I'm using VS Code to connect to the remote server and the .sql file with the contents of the dump has no errors, but when I try and copy it to a different workspace on my local computer, I get many syntax errors.
Examples of the syntax errors:
DROP TABLE IF EXISTS `accounts`;
CREATE TABLE `accounts` (
`table_number` int(11) NOT NULL AUTO_INCREMENT,
`account_id` varchar(12) NOT NULL,
`account_name` varchar(5) NOT NULL,
PRIMARY KEY (`table_number`)
) ENGINE=InnoDB AUTO_INCREMENT=261 DEFAULT CHARSET=latin1;
Incorrect syntax near '`'. Expecting '(', or SELECT.
Incorrect syntax near '11'. Expecting '(', or SELECT.
The error about the ` character is present before "accounts" and before both instances of "table_number" but not before "account_id" and "account_name". Every number in the CREATE has the incorrect syntax warning. I've tried retyping rather than copy and pasting to see if there's hidden characters responsible for these issues, but no luck.
Is this an OS issue? The remote server is a CentOS machine and my local is macOS Catalina. A setting in VS Code I need to specify or change?
We are unable to upgrade the zabbix version to 4.4.. there seems to be an error with upgrading Database. Could someone help on this:
[Z3005] query failed: [1005] Can't create table 'zabbix.#sql-179d_144bb0' (errno: 135) [alter table `hosts` add `proxy_address` varchar(255) default '' not null]
This error is shown in logs. I tried to give privileges to zabbix user but no use
This issue got resolved.
The FS where database is stored has 100% utilization. Extending the FS resolved the issue.
I'm using Ubuntu 16.04 and I'm able to use MySql from the command line fine. I can create a db, add tables, add rows to tables, get queries etc.
What I can't do is write an sql file and run it.
From a regular terminal I change into the directory containing my script test.sql
Then I run mysql -u root -p > test.mysql and it asks me for my password. If I put the wrong password I get an error and if I put the correct password nothing happens, the terminal behaves as if its expecting further input.
If I have MySql started and I do
mysql>SOURCE /home/ryan/MYSQL_Scripts/test.sql
I get Failed to open file '/home/ryan/MYSQL Scripts/test.sql', error: 2
I know this means the file could not be found or supposedly does not exist yet from my explorer I right clicked on the file to get info on its path so I think the path is okay.
I don't think there's anything wrong with my script since I can run the commands individually from the mysql prompt. Here's my script:
USE first_db;
CREATE TABLE Department(id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30) NOT NULL);
CREATE TABLE Employees(id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30) NOT NULL,
department_id INT(6) NOT NULL);
INSERT INTO Department (name) VALUES ("Fire");
SELECT * FROM Department;
I of course have a db, first_db, already created and am able to interact w/ it from the mysql prompt I just need help using mysql scripts.
Some advice would be much appreciated. Thanks!
`
JNevill's method worked right away, mysql -u root -p < test1.sql is the correct command to execute a mysql script from the command line.
Robert Harvey is onto something w/ the path reference. Not sure yet why the path I've used is incorrect though.
I get the error "Table 'mysql.servers' doesn't exist" from plesk when I try to create a new database user, the created user does not show up anywhere but the name is still reserved, and it does not allow me to access the database.
edit:
I was unable to login to phpMyAdmin to this webserver, so instead I managed to login to it through a different domain, and it tells me a notice: Your PHP MySQL library version 5.0.90 differs from your MySQL server version 5.1.49. This may cause unpredictable behavior.
edit:
manually installed phpmyadmin
then manually installed libmcrypt (which is an accomplishment with my cruddy sever skills :D) so that phpmyadmin works.
Then accidentally found out how to login as root via plesk (the trick is to enter webadmin without choosing any database), at least I think it's root :S
ran the sql: GRANT SELECT ON mysql.* TO 'my-user'#'localhost'; with a success message
went back to plesk to see if I can manage the sql with "my-user" and no, its still missing from the available users, but the name is still reserved...
tried to run: mysql_fix_privilege_tables –user=root –password=mypasswordobviosuly –verbose
but gave and error, and i'm still not sure how to run direct mysql commmands without using ssh (because i dont know the root password)
I entered mysql via pre-installed phpmyadmin as 'root' like so:
(in plesk) home-> database servers -> webadmin.
Then choose the "mysql" database, if the table 'servers' is missing (probably some mysql bug) then it will need to be created:
choose 'SQL' in 'phpmyadmin' to and run the following sql:
CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL,
`Host` char(64) NOT NULL,
`Db` char(64) NOT NULL,
`Username` char(64) NOT NULL,
`Password` char(64) NOT NULL,
`Port` int(4) DEFAULT NULL,
`Socket` char(64) DEFAULT NULL,
`Wrapper` char(64) NOT NULL,
`Owner` char(64) NOT NULL,
PRIMARY KEY (`Server_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table';
so that the table at least exists... then create a new user in plesk, and viola! it works! I was able to login as the user I created after that, it seems like it was some bug with some mysql update I did not even know about.
This error can sometimes appear after a new installation of MySQL when the mysql table does not get created properly. Running the command...
mysql_install_db --user=mysql
from the bash prompt (not the MySQL prompt) will install the table and get things working.
After running the command above on a new installation the following command will help secure the install...
mysql_secure_installation
This will prompt you to enter a root password, remove anonymous access, limit root access to localhost only and remove the test database.
These commands are for Linux, they may not work on Windows but there are corresponding commands if you search the MySQL docs.
This is not related to the Plesk issue of the original poster but I stumbled upon this question while researching a MySQL installation problem and thought this might help save someone some time.
Found the following when attempting to upgrade. Was directed to the following page:
http://kb.parallels.com/en/112290
I ran the following from that page:
"Run the following command for repairing MySQL table:
#mysql_upgrade -T --debug-check -u admin -p`cat /etc/psa/.psa.shadow` mysql"
It looks like your user does not have access to the mysql database. You may want to grant the SELECT command as follows:
GRANT SELECT ON mysql.* TO 'your-user'#'localhost';
In my case show tables in mysql database identifies servers table exists, but yet I got the Error Table 'mysql.servers' doesn't exist error.
Listing <data-dir>/mysql directory revealed servers.frm file exists, but relative servers.MYI and servers.MYD files were missing - maybe I played a role on that!
Anyhow knowing that I'm using the server as an intermediate server in a Daisy Chain Replication, I got a backup from servers.frm file and recreated the table by running the #timo-huovinen's answer things got back to normal.
It's noteworthy that there was at least one other table (plugin) missing MYI and MYD files.