Latest Questions tagged Mysql

Browse all latest questions tagged Mysql

Published 05 Dec, 2022
How to generate unique id in MySQL?

I'm programming a script using PHP and MySQL and I want to get a unique id (consisting of a string: capitals and small letters with numbers) like: gHYtUUi5b. I found many functions in PHP that can g...

Published 30 Oct, 2022
Java - Wildfly datasource does not connect to MySql database

I am completely new to Wildfly/JBoss so i am clueless what to do, i am sitting on this problem since yesterday noon. I am trying to use the mysql-connector-java-8.0.20.jar as the connector and my Wil...

Published 14 Nov, 2022
SQL How to replace values of select return?

In my database (MySQL) table, has a column with 1 and 0 for represent true and false respectively. But in SELECT, I need it replace for true or false for printing in a GridView. How to I make my SEL...

Published 07 Nov, 2022
How to skip certain database tables with mysqldump?

Is there a way to restrict certain tables from the mysqldump command? For example, I'd use the following syntax to dump only table1 and table2: mysqldump -u username -p database table1 table2 > dat...

Published 26 Aug, 2022
Python - Python and MySQLdb warnings

I have a program that is exporting MSSQL data and importing it into MySQL. I have a function that is importing as follows: def importMySql (mycursor,exportedfilename,table,delimiter): file_loc =...

Published 01 Dec, 2022
How to find rows where all values of a column are same?

I have a table user_test_access which stores test_id and user_id. user_test_access table stores all the uses who have access to the test as well as which user created the test. id test_creator tes...

Published 02 Dec, 2022
How to select multiple static rows with one SQL query in mysql

We all know that: select 1,2,3 will give us: |1|2|3| However, what I want to get is: |1| |2| |3| I am aware that it can be achieved by "union"s like: select 1 union select 2 union select 3...

Published 20 Aug, 2022
Python - MySQL One-to-Many to JSON format

I have two MySQL tables: User (id, name) Sale (id, user, item) Where Sale(user) is a foreign key to User(id), so this is a one-to-many relationship (one user can make many sales). I'm trying to ge...

Published 18 Nov, 2022
How to select different columns based on the value of specific column´╝č

There are two tables with similar contents.I need to join them on the key 'id' to compare the value.They look like below: table_A id item_name item_value 1 cost 1.00 1 price 3...

Published 07 Sep, 2022
Java - Why can Java not connect to MySQL 5.7 after the latest JDK update and how should it be fixed? (ssl.SSLHandshakeException: No appropriate protocol)

In the latest update to the JDK in April 2021 (11.0.11+9-0ubuntu2~18.04) support for TLSv1 and TLSv1.1 was dropped, presumably because since March 2021 those versions are no longer supported. This is...

Published 15 Nov, 2022
How to first join tables and then filter rows to keep the greatest per group

I'm trying to write a SELECT statement that first joins two tables and then filters rows, by keeping the max value per group. Example The following two tables describe visitors in a zoo. visitors tab...

Published 15 Nov, 2022
How to return rows containing decimals in a range

I have the following table: Rows Decimals First Second Third Fourth I only want to return the rows where the second to last decima...

Published 08 Aug, 2022
Jquery - Using AJAX to open php file

So I am trying to open af php file that updates something in my database. I want to do this using AJAX since I dont want my entire page to update. After the php file has been ran I want to change an i...

Published 25 Aug, 2022
Java - Unable to configure second level cache of hibernate-ehcache-4.3.5.Final.jar in Hibernate 5.1.0.Final

I'm trying to achieve second level cache in my Java EE project using Hibernate. My Hibernate version is 5.1.0.Final. I've created a table employee in my MySQL database. I've included hibernate-ehcache...

Published 06 May, 2022
Python - How to create a new table in a MySQL DB from a pandas dataframe

I recently transitioned from using SQLite for most of my data storage and management needs to MySQL. I think I've finally gotten the correct libraries installed to work with Python 3.6, but now I am h...