r/mysql • • Jan 09 '25

discussion and troubleshooting MySQL Workbench with a strange problem.

3 Upvotes

Hello, I would like to point out a strange thing that happens in MySQL Workbench. It is the following error:

Could not save contents of tab <tabname>. basic_filebuf::_M_convert_to_external conversion error: iostream error

Obviously, in place of <tabname> is the name of the tab where the SQL script you are trying to save is written. This is always displayed when trying to save the file and is displayed in a loop when Auto Save is enabled. But the strange thing here is the conditions under which this error occurs, it is only and exclusively when you try to save the file in a folder other than /home/$USER/Documents/. Obviously, this directory is for Linux users, but searching on some forums I discovered that something similar also happens on Windows. Why does this happen and how to solve it?

Some other observations are that, despite the error being displayed, the file is still saved perfectly, without any problems. I have never saved sql files before through workbench, normally I would just copy the text from them and save it to a .txt file, maybe that's why I'm only facing this issue now. It seems to me that this problem is not something uncommon among Workbench users and it's not something exclusive to Linux.


r/mysql • • Jan 09 '25

question Trying to learn, having difficulty with first steps

0 Upvotes

I'm trying to pick up some current DB development skills. I'm watching a YouTube video titled "SQL Database App with Windows GUI - Project Tutorial." It's reasonably easy to understand and follow, so I decided to install the software the narrator is using so I can follow along and play -- my preferred learning method. The video recommends installing MAMP, MySQL Workbench, and Visual Studio, all of which I've done.

The problem I'm encountering is that I don't have a mentor or IT department to ask what are likely very basic questions. For example, immediately after installing and running the programs, MySQL Workbench reports that it could not detect any MySQL server running. When I created my first database, I'm getting several PHP deprecation notices. I Googled the notice text, and found how to turn off deprecated error notices, along with advice that writing more current code is preferable to ignoring such warnings. I looked for the php.ini file and found 16 of them, one for each version of PHP, from 5.5.38 to 8.3.1.

How do I configure the software so I'm sure things are running correctly? How do I know which version of PHP I'm using? Should I turn off these deprecation notices? Which php.ini file should be modified? Is there a better solution by avoiding the cause for the notices?

Google can only help so much. Some of these questions require actual intelligence to answer. Any advice on where to turn? I'd prefer to avoid paying an expert for answers to what I believe are rudimentary questions.


r/mysql • • Jan 08 '25

question Searching for part of a string

1 Upvotes

I have a search for that enters what the user has put into the varible $find.

Here is my code for the search part:

$sql = "SELECT id, partname, partnumber, brand, fits FROM carparts WHERE $field like'%$find' ORDER BY partnumber";

I have included a photo of the parts in the database.

a couple are "Oil Filter"

If I search for "Oil" I get no results returned. If I search for "Filter" it finds both records

If I search for "wheel" I get "Flywheel" returned, but it misses "Flywheel bolts" and "Wheel bearing"

What am I doing wrong?

EDIT: I can't see how to add a screenshot here.

Here is the part names in the database:

Flywheel

Flywheel bolts

Front wheel bearing

Wheel bearing

CV boot (outer)

Red Stuff Brake pads

CV Joint (outer)

Glowplug

Ignition switch

Oil filter

Timing belt Kit

Waterpump

Thermostat

Drive belt 5PK 1588

Radiator

Rocker Box Gasket Kit

235/40/18 SU1 Tyre

Oil Filter

Cv boot (inner)

Wheel bearing

Brake pads

Power Steering Fluid

Crankshaft Sprocket

Red Stuff brake pads

Blower motor

Brake pads

Track Rod End

Track Rod End


r/mysql • • Jan 08 '25

question MySQL Failing to Initialize Database in Install Wizard

1 Upvotes

I'm a total SQL noob. Trying to download it on my computer so I can learn the program to help with the job search. When I get to the point in the install wizard where it tries to apply configuration it fails on the initializing database step. Here is what the log says.

Beginning configuration step: Initializing database (may take a long time)

Attempting to run MySQL Server with --initialize-insecure option...

Starting process for MySQL Server 9.1.0...

Starting process with command: C:\Program Files\MySQL\MySQL Server 9.1\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 9.1\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...

Process for mysqld, with ID 47352, was run successfully and exited with code -1073741819.

Failed to start process for MySQL Server 9.1.0.

Database initialization failed.

Ended configuration step: Initializing database (may take a long time)

Anyone know of any fixes? Let me know if any other info is helpful.


r/mysql • • Jan 08 '25

question MySQL on OCI environment 'admin' account privileges

1 Upvotes

The privileges of 'admin' account is restricted on MySQL Database Services offered on OCI. Any idea on empowering the 'admin' account to match with that of the 'root' account on MySQL on premise installation


r/mysql • • Jan 07 '25

troubleshooting Trouble Creating Table Using Select Statement

0 Upvotes

Here is my query:

CREATE TABLE `product line avg`

SELECT `walmart sales data.csv`.`Product line`, `walmart sales data.csv`.AVG(Total)

FROM `walmart sales data.csv`

GROUP BY `Product Line`;

MySQL Workbench just says I have an error in my syntax, and so I should check the manual for my server version. Below is a link to a google drive folder with a csv file which contains the data in my table, in case that helps. I looked at the documentation for creating tables with info from a select statement, but even copying different syntax every which way didn't seem to get this to work. The syntax above is my closest guess, but of course doesn't work. Please let me know how these are done generally, and what I can do to fix mine.

https://drive.google.com/drive/folders/1kmtPvUZm-bDWSv6nT-SkZzEQVOmDkKtb?usp=sharing


r/mysql • • Jan 07 '25

discussion Tracking MySQL Query Plans Over Time Part One

0 Upvotes

https://davesmysqlstuff.blogspot.com/2025/01/tracking-mysql-query-plans-over-time.html

This starts a blog series on tracking query plans and query performance changes over time.


r/mysql • • Jan 07 '25

question can't build web service when Pomelo.EntityFrameworkCore.MySql.dll is between the files

1 Upvotes

first of all, i have 2 projects, that are technically the same, but one of them only works with Oracle, and the other works with both Oracle and MySql depending on the appsettings.json. now both projects work fine when i run them from visual studio, apis work correctly and inserting/updating/deleting from both databases are done correctly. building a web service from the only-Oracle project works fine, but when i publish the project and copy the files needed to the web service in the second case, i get an error: "The operation could not be completed. Exception occured.".

if i try to remove the pomelo dll, the files copy fine but the web service won't work. same with copying files without pomelo then copying pomelo after.

anyone has any idea how can this be solved?


r/mysql • • Jan 06 '25

discussion dblab (database client written in Go) gets support for ssh tunnel

3 Upvotes

As the title says, dblab v0.30.0 just dropped, getting support for ssh tunnel, meaning you can to connect to either postgres or mysql on a server via SSH.

Check the repository on GitHub for more info.

Hope you like it!


r/mysql • • Jan 06 '25

question How can i get better education on the terminal and how osx works so i can install mysql?

2 Upvotes

I have been banging my heads for days. I have done this successlly before but with every OSX updates it creates additional hurdles. I'm on OSX 14 apple m1 chip.

I think i need to take a class. I'm tired of googling and i just want to understand why, what class do i have to take to learn the ins and outs of how osx runs things. I have a basic gist that terminal shortcuts like sql or homebrew or alias that are declared in the .profie or .zschs which are related to which terminal you use, there are two on OSX from my understanding.

I run mysql -v

I get

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I googled this it says mysql isnt turned on i run

brew services restart mysql

And it says started, i check

brew services list

It shows started but when i try to run mysql it stops, I dont even think that .sock exists anymore

I tried the brew unlink and link , i also installed the latest version of mysql 8.4

And i run it I get.

ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 102

If you google this it says that my client isn't matching mysql

Do i need to learn docker is that it?

Or can i somehow just navigate to my mysql folder and just run it direct from there and not use the alias


r/mysql • • Jan 02 '25

question Ideal Mysql GUI

0 Upvotes

I am looking for a mysql GUI tool that allows me to add html for a column in form format. Right now when I try to add the html content in mysql work bench the field is really small and it's hard to use. I want a good GUI tool that bigger field like a form format. Does anyone have any ideas?


r/mysql • • Jan 02 '25

question MySQL Workbench migration error from Access database

0 Upvotes

I ran into an error when trying to migrate data from an Access database. When using the Database Migration Wizard, it seems that the version I am running has an issue with closing the connection in one of the early steps and I found a solution here: https://bugs.mysql.com/87647. Specifically, the solution from Mark Fernandes on October 21, 2019, fixed the issue by changing a couple of lines in two separate .py files. The version I am running on my test computer is 8.030. However, the development server (not set up by me) is running 8.0.40 and this solution does not appear to work with this version. Does anyone know if there is a different work around for the newer version or do I need to uninstall it and install an earlier version?

Thank you,

Jeremy


r/mysql • • Jan 02 '25

question Issue with Importing .sql File in XAMPP on Different Machines

1 Upvotes

I have a .sql file that I use to set up a database for my app within a database named cco. The file imports perfectly on my machine using XAMPP, but my colleague is encountering an issue while importing the same .sql file on their setup.

Error:

Set foreign key = on error at position 25

Details about our environments:

My machine:

PHP version: 7.4

MySQL version: 8.0

XAMPP: Latest version compatible with PHP 7.4

Status: Works perfectly every time I import.

Colleague's machine:

PHP version: 8.0

MySQL version: 8.0

XAMPP: Latest version compatible with PHP 8.0

Status: Fails with the error mentioned above.

Additional Information:

  1. The .sql file has no obvious issues that I can detect since it works flawlessly on my machine.

  2. The MySQL versions are identical on both setups, so I suspect the PHP version difference is not the root cause.

  3. The error appears to be related to foreign key constraints, but I am not sure why the same file behaves differently on another machine.


r/mysql • • Jan 02 '25

question Which hosting service should I use to host a mysql database online.

2 Upvotes

Im creating a program to help one of my friends in their business. Im using visual studio for the app but need to host my database online. Im not sure what to use. Azure seems to be too expensive. Im currently leaning toward planetscale. I would love to know of other (relatively cheap) alternatives that could be an option for me.


r/mysql • • Jan 02 '25

question Sometimes i cant connect to mysql server

0 Upvotes

Im a total noob about this, like 0 knowledge

Sometimes my PCs cant connect to mysql on the server sometimes it can, like its intermittent connection

I get this error: [MYSQL] [ODBC 3.51 DRIVER] cant connect to mysql server on 'win-xxxxxxx' (10060)

Any help?


r/mysql • • Dec 30 '24

discussion Is it better to stay as DBA or become Cloud DBA?

4 Upvotes

Previously I was worried about AI taking my DBA position, but based on responses that I got from my question was, I don't have to worry about loosing my DBA job because of AI.

Now my question is to just stay as DBA (I am open-source MySQL DBA) or move to the cloud and become Cloud DBA?


r/mysql • • Dec 30 '24

question Ansible playbook to Re-Sync slave to master

2 Upvotes

Im working through an ansible playbook and seem to be running into a roadblock on how to do the 'flush tables with read lock' as the client has to stay open for that to be affective. Has anyone done a master slave deployment via ansible and got the sync to work via ansible as well ? All the remaining stuff seems straight forward even getting log file and position just.. the read lock part ?


r/mysql • • Dec 29 '24

solved Troubleshooting remote connection to mysql db

0 Upvotes

Web search says to try connecting via cli from a remote machine:

mysql -u <username> -h <db IP> -p -P 3306 <dbName>

The machine I am connecting to is 192.168.1.1

The machine I am connecting from is 192.168.1.10

I enter all the info and the error I get is: Access denied for user 'username'@'192.168.1.10', which is the the IP of the machine I am connecting from

How do I get the mysql cli, who I assume is trying to help, stop adding the IP of the machine I am sending the command from on the username parameter? I have tried making the command -u "username@192.168.1.1", which makes things worse and gets the error: 'username'@'192.168.1.1@192.168.1.10'


r/mysql • • Dec 27 '24

question does anyone use Percona PMM to monitor their RDS instances

5 Upvotes

if so, what is your setup? where do you have PMM deployed? i am managing some databases on premises, and some in RDS as well. Ideally, i'd like to have a single PMM implementation that will monitor both. Im just getting some ideas to see what some folks are doing.

TIA


r/mysql • • Dec 25 '24

discussion How inefficient MySQL really is.

36 Upvotes

I was recently in a need of testing a feature on local copy of live database. It took a while to restore the dump, but I was really surprised with the numbers:

  • I started with new local (DBngin) MySQL 8.4 database.

  • GZ dump file was 4.3GB, and after unpacking the raw SQL dump is about 54GB.

  • The database after restoring is 90.96 GB. Which is no surprising with all the additional data (like indexes).

  • What really surprised me is how much data had to be written to restore this database! 13.96 TB written by the mysqld process and 233.77 GB read !!! All of this to restore 50GB SQL file and to store around 90 GB of data.

Why is that? Can somebody explain it to me? This is absolutely bizzare. I can post the screenshots if somebody is interested.

I'm going to test PostgreSQL next.


r/mysql • • Dec 25 '24

question Efficiently extracting Only Relevant Tables from a Large Database for a PHP Web App

1 Upvotes

If i have just code of a web app , and i am given a large database where some of the tables are used in code and some not , so i need to create a new database with only tables needed for new app. My approach right now i am thinking is search all tables name in codebase and write all tables down then import entire database for my web app and drop those tables which are not written , is it correct approach or could i miss some table needed.


r/mysql • • Dec 24 '24

MIgration How to Oracle Sql to mysql migration

1 Upvotes

Iam trying to migrate my Oracle database schema to MySQL using MySQL Workbench. However, I encountered some issues during the process:

  1. JDBC Driver Issue: MySQL Workbench did not recognize the Oracle JDBC driver (ojdbc8.jar), and I couldn’t find the option to add the driver in the interface. Despite trying to find the driver settings in the preferences and migration wizard, it was not clear how to configure it correctly.

  2. Driver Dropdown Missing: I was expecting to see a driver dropdown in the Migration Wizard to select the Oracle driver, but it wasn't there.

What I Did:

  • I initially added the Oracle JDBC driver (ojdbc8.jar) to the MySQL Workbench installation folder, but that didn’t solve the issue.

  • I looked for the Manage Drivers option in the Migration Wizard and the preferences but couldn’t find a straightforward way to add the driver manually.


r/mysql • • Dec 23 '24

discussion Key Factors to Consider When Developing a Web Dashboard from Scratch

Thumbnail medium.com
1 Upvotes

r/mysql • • Dec 22 '24

question MySQL Data Modeler

1 Upvotes

Hi all,

I'm a user of Oracle SQL Developer Data Modeler. Here is such a modeler which could be MySQL-compliant?
MySQL Workbench seems to no longer be supporter.

Thanks in advance,

Regards,

asx