658,897 questions
587
votes
28
answers
961k
views
Connection Java - MySQL : Public Key Retrieval is not allowed
I try to connect MySQL database with Java using connector 8.0.11. Everything seems to be OK, but I get this exception:
Exception in thread "main" java.sql....
0
votes
1
answer
15k
views
Getting: 'Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]' Exception when doing Hibernate CRUD project
I am doing a 'JAVA project' in Eclipse Enterprise Edition IDE. Hibernate CRUD project to create user (student) details in my MySQL database (hibernatestudent). Hibernate version is Hibernate ORM core ...
2
votes
4
answers
54k
views
How to get max(id) in CodeIgniter
I want to get the maximum id of row data. In my table first column is id then firstname and etc.
this is the sql command I used to get the max(id) of row data.
$maxid = $this->db->query("...
1
vote
3
answers
272
views
Fetch record with MAX() column value in CodeIgniter [duplicate]
I want to echo the record that has the MAX() value in a specified column using CodeIgniter. How do I do that?
I have table like this:
id|value
1 | 3
2 | 1
What I've tried so far is to use query: ...
0
votes
2
answers
207
views
get(column_name) after query(SELECT MAX(column_name)...) doesn't return the MAX value [closed]
I need to fetch the highest value from a mysql db column. It's a timestamp. Using mysql MAX function it's not working, bellow you can see the code:
//Create new db object
$db = new Db();
//Query
$...
7
votes
4
answers
28k
views
How to insert data into the database using spring + hibernate?
see i m havving user.java for the user info.
@Entity(name = "user")
@Table(name = "user")
public class User {
@Id
@Column(name = "id")
private String id;
@Column(name = "password")
...
0
votes
1
answer
172
views
Find the most recent dates in looking backward and looking forward dates from a specific date column
I have three columns in my data set:
The date when Item X was purchased
The date when Item Y was purchased
The date when Item Z was purchased
Sample data:
set.seed(100)
Y <- sample(seq(as....
6
votes
6
answers
80k
views
SELECT MAX column value relating to the MAX column value of another table with CodeIgniter's query builder
I'm trying to get a max value with CodeIgniter from an table but it isn't working. This is the error I get:
Severity: 4096
Message: Object of class CI_DB_mysql_result could not be converted to
string
...
3
votes
1
answer
9k
views
What's the meaning of the error code (60)?
Given the following client error message:
Error: Can't connect to MySQL server on 'server' (60)
What's the meaning of error code 60? MySQL v5.6 and v5.7 do not provide any info about it in docs, on ...
2
votes
1
answer
402
views
how expensive is constantly opening and closing a connection to mysql?
I have a python script that is currently connecting to my mysql database every 60 seconds, checking something, then closing the connection, so every minute I am doing this open/close of the connection....
Advice
0
votes
9
replies
141
views
How to make it so a parent NEEDS its children to exist in MySQL?
I am designing a DB where basically parent can't exist without two children. E.g: Entity set Marriage, CAN'T exist without entity set Man and entity set Woman, but neither Man or Woman need Marriage ...
0
votes
3
answers
1k
views
Is there a way get rows matched? (in addition to affected rows)
After running an update query in a Stored Routine:
Update table1 set value='a' where id=1
if the table already has an identical row (with id=1 and value='a'), I'm getting the following message:
0 ...
Best practices
0
votes
7
replies
88
views
MySQL SELECT … FOR UPDATE causing table lock during high traffic while generating sequential transaction IDs
I have a PHP + MySQL project where I need to generate sequential transaction IDs.
Each transaction can have multiple items, so all rows for that transaction must share the same txn_in value.
Tables
...
0
votes
1
answer
455
views
Migrating three derby databases to one MySQL database
We've got a Spring Hibernate, Apache Derby (Database) Java application running on Jetty server.
Problem
We've got 3 Apache Derby databases (DB1, DB2,DB3) that we need to migration in one MySQL ...
2
votes
1
answer
578
views
Multiple where condition codeigniter active record [duplicate]
I want to make a multiple where query with AND and OR. Suppose my array is:
array (size=8)
0 => array (size=2)
'timeline.type' => string 'videos' (length=6) ...
-2
votes
0
answers
67
views
Как подключить python скрипт к базе данных mysql на phpmyadmin? [closed]
Пароль я использую настоящий, тут я его просто скрыл. Объясните мне пожалуйста, что я сделал не так? Вот сам скрипт:
import pymysql
try:
# Подключение к базе данных
connection = pymysql....
1
vote
2
answers
1k
views
Driver not found when using ODBC MySQL Driver for Linux
Have an issue with MySQL ODBC Driver on Ubuntu 22.04 with Tableau Server.
Attempting to connect result in error:
[unixODBC][Driver Manager]Can't open lib '/usr/lib/x86_64-linux-gnu/odbc/libmyodbc8w.so'...
2
votes
2
answers
9k
views
Open connection to MySQL from VBA Excel 2007
I got this error when try to connect Excel and MySQL using ODBC
DataSource name not found and no default driver specified
Here is my VBA code:
Sub test123()
' Connection variables
Dim conn As ...
2
votes
2
answers
721
views
Concurrent Inserts in mySQL
I have 3 table - TB1, TB2 and r_tb1_tb2 (innoDB)
TB1 Hold the details of the users (will be inserted)
- id (primary, unique)
- name
TB2 Holds the details of the course the users can take (static ...
-1
votes
0
answers
33
views
Dapper Mapping not working as expected. Using myql, asp.net core web api [closed]
I am fetching ProductTransfer table together with related products. Although the total records = 1200, am only getting three records returned by my api.
Here is my models
public class ...
1
vote
2
answers
2k
views
Change column data type while creating table in mysql
I am creating new table from existing table using select query. The existing table column having data type varchar(255) so in newly created table that column contains varchar data type as default.
...
138
votes
12
answers
157k
views
MySQL/Amazon RDS error: "you do not have SUPER privileges..."
I'm attempting to copy my mysql database from an Amazon EC2 to an RDS:
I successfully did a mysqldump of my database into my root folder using this:
root@ip-xx-xx-xx-xx:~# mysqldump my_database -u ...
1
vote
3
answers
5k
views
Fatal error Allowed memory size exhausted with WooCommerce WordPress plugin
I keep getting the error below when adding an item to my cart. It just started showing up and I have more than enough memory left in the database. I have searched online to find a solution and I have ...
90
votes
15
answers
393k
views
Can't import database through phpmyadmin file size too large [closed]
I have been trying to import Database through phpMyAdmin. My database file is a.sql and it's size is 1.2 GB
I am trying to import this on local and phpMyAdmin is saying:
You probably tried to ...
1
vote
1
answer
59
views
I need to update a row in a table after the use of a view in MySQLWorkbench
It's been a while since i used MySQLWorkbench to make queries and i'm kinda lost here.
I want to update a row in a table named last_export that refers the last time a specific app had access to the ...
0
votes
1
answer
244
views
using switch case for update MySQL query [closed]
Can you help me I wanna update my table by using switch case in MYSQL
id value_s
-------------
1 one
2 two
3 third
14 fourteen
24 twenty-two
34 thirty-four
11 eleven
I wrote query but its ...
2
votes
3
answers
143
views
What is the meaning of that Database is the highest levels in MySQL structure? [closed]
In the book Learning PHP, MySQL, JavaScript, CSS, and HTML5 – A Step-by-Step Guide to Creating Dynamic Websites (6th Edition), it says: “The highest level of MySQL structure is a database.”
What does ...
Advice
1
vote
5
replies
160
views
Can I make MyDAC update a blob field faster?
So I'm uploading around 50MB into a longblob in a local mysql server.
Using LoadFromStream, setting the param value is near-instantaneous but the execution of the UPDATE statement takes around 2 ...
4
votes
2
answers
966
views
Does mysql python connector Cursor execute insert integer parameters with %d?
I'm trying to insert data records into mysql database with mysql-python-connector.
The Cursor API (https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursor-execute.html) ...
60
votes
14
answers
126k
views
cryptography is required for sha256_password or caching_sha2_password
I used the following python code and got this error.
Print(e) = "cryptography is required for sha256_password or
caching_sha2_password"
And have no idea how to solve the error....
2
votes
1
answer
74
views
Ambiguous column in WHERE clause after JOINing tables with CodeIgniter query builder
I'm trying to do a Join between three tables, in which in one table could not be informations to do the join.
This my tables:
Meetings
id
docent_id
motivation
Persons
id
name
surname
Companions
...
0
votes
2
answers
418
views
CodeIgniter's get() method doesn't receive WHERE conditions as expected
I have gone through many questions about joining 3 tables in Codeigniter, but I am stuck in these lines of coding that includes returning products array.
function products_sorter($region)
{
$this-&...
3
votes
4
answers
2k
views
Only JOIN the related record with the highest column value using Codeigniter
I have three tables
1.article (id,article_title)
2.article_status(id,article_id,stage_id)
3.article_stages(id,stage_name)
Each article have multiple insertion in table 2. I want to fetch the last ...
1
vote
2
answers
124
views
How to pass a table name as a parameterized value into CodeIgniter's query() method
I am trying to select info from my database with CodeIgniter. Here is the code:
public function getContent($table_name)
{
$show = false;
$sql = 'SELECT * FROM ?';
$query = $this->db->...
0
votes
1
answer
56
views
How to implement parameterized AND condition in Codeigniter using Query Helper Methods [duplicate]
I have a LEFT join query with an AND condition:
SELECT a.s_id AS sid,a.s_prog_id AS progid,a.s_acssn_id AS ssnid,a.s_name AS sname,a.s_admission_no AS sadmsnno,a.s_photo_name AS sphotonm,
b....
0
votes
1
answer
1k
views
Codeigniter - query builder, left join, unprepared PHP variable in 'on clause' [duplicate]
May be you have some idea how I can escape `$this->lang'.
This is my actual query:
$this->db->select('p.id, p.photo, p.desc, info.desc');
$this->db->from('products as p');
$this->db-&...
3
votes
2
answers
1k
views
Error number 1054 from raw SELECT query executed by CodeIgniter's query() [closed]
I'm having a problem with selecting data from my database. It show me following error
A Database Error Occurred
Error Number: 1054
Unknown column 'BA' in 'where clause'
SELECT *
FROM crime_details
...
0
votes
3
answers
97
views
How to JOIN two separate tables to a parent table with CodeIgniter's query builder [duplicate]
I'm trying to join 3 tables from my database.
database 1 : dkm (id, tgl, ref, etc)
database 2 : order_product (kode_barang, packing, nama_barang, etc)
database 3 : product (kodeprod, tglpakai, etc)
...
3
votes
3
answers
14k
views
Mentioning the same table in CodeIgniter's from() and get() query builder methods incorrectly shows two tables in the FROM clause
I have 3 tables in my database :-
tbl_roles(role_id,role_name);
tbl_users(id,role_id,username,email,password);
tbl_tickets_replies(id,ticket_id,user_id,role_id,comments)
role_id, id, id are primary ...
Best practices
1
vote
3
replies
73
views
Deleting large data without stopping the active mysql server
I'm using a table of approximately 1TB in a MySQL database. This table also has a monthly partition. We store the last two months of data in this table and regularly truncate the data from the ...
1
vote
2
answers
9k
views
Mix of AND and OR conditions in WHERE clause with CodeIgniter's query builder
I want to run a query in CodeIgniter.
The query is
SELECT *
FROM td_album,td_image
WHERE td_album.album_id=td_image.album_id
AND td_album.album_id='$id'
AND (td_image.image_name='$name' OR ...
1
vote
4
answers
1k
views
Xampp shows MySQL shutdown unexpectedly; isn't working unless every time of reinstalling xampp,
My Xampp server is showing "MySQL shutdown unexpectedly". I did follow some solution to this problem but still it doesn't fix. All I have to do is every time I have to use MYSQL I uninstall ...
0
votes
2
answers
19k
views
How to create a function using MySQL Workbench?
I have an MSSQL background.
I am trying to create a function in MySQL Workbench by rightclicking on 'Functions' > 'Create Function'.
I insert this text to create the function into the window but ...
-1
votes
2
answers
84
views
How to return null record with header after fail insert?
I'm writing a stored procedure and I encountered an issue with return records after insert.
I know we can use row_count to know if the insert was successful or not.
And my goal is:
If it success, ...
1
vote
2
answers
781
views
Ultimate way to use UTF-8 in mysql
I have read many articles, discussions and tutorials about using utf-8 charset in mysql. Several approaches are introduced apparently for different cases (e.g. transfering to utf-8). What are the ...
0
votes
1
answer
207
views
Is there a way to use a MySQLI connection the same way I was using the MySQL connection before? [duplicate]
Thanks to a poster here at SO, I started using MySQLI and prepared statements. However, there is one issue I'm not sure how to adapt from the way I used MySQL.
Before, I would open a connection to ...
2
votes
4
answers
1k
views
Get qualifying records from one table which do not have disqualifying records in another table using CodeIgniter's query builder
I have three tables namely: tbl_users, tbl_account_details, and tbl_attendance.tbl_users looks like this
user_id username role_id activated banned
1 admin ...
0
votes
1
answer
128
views
How to get particular string from my table?
My table column contains following sample data:
/Users/abct2/Library/Application Support/iPhone Simulator/4.3/Applications/FD301781-D39F-469E-A604-8164CC9A4493/Library/Caches/List3-ROHAN TEST1/...
14
votes
2
answers
12k
views
Does IGNORE clause work with bulk insert? [closed]
I have a bunch of data that I want to insert, and I have decided to use bulk insert for MySQL.
Insert into friends (requestor, buddy) values (value1, value2), (value2, value1), (value3, value4), (...
2
votes
1
answer
2k
views
Populate hierarchical result structure after JOINing 3 tables in CodeIgniter
I have a table structure for user order into various shop like below. Now I want to get the query will be in codeigniter.
Select list of shop_id belongs to the user_id
Select the list of products ...