Professional Hypertext Preprocessor, a widely used platform for dynamic web applications.
1
vote
1answer
1k views
Server requested authentication method unknown to the client [mysql_old_password]
Warning: PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password]
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the ...
1
vote
3answers
1k views
How can I copy data from one MySQL server to another based on a SELECT statement (then delete the data from the original)?
I have a very large log table from which I want to copy rows, putting them into the same table structure on a new server. I don't want to copy everything, only old rows, so that the table on the main ...
2
votes
1answer
233 views
Mysql - show results from 3 tables excluding NULL or EMPTY values for certain fields
I have 3 simple tables with polls, users and votes. I'd like to show all polls ordered by clean count of votes (sometimes either poll_id or user_id don't get inserted).
Furthermore I'd like to show ...
0
votes
1answer
854 views
Connect Error (2054) - mysql_old_password issue still not solved
i use php 5.4.3 and i want to connect to a MySQL DB remotely (php script resides on a different server than the db) with normal oop way:
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
...
0
votes
0answers
96 views
Does codeigniter support conditional insert? [closed]
I need to check a condition before inserting a row into the table. Is it possible in codeigniter?
1
vote
1answer
100 views
MySqli - select from db based on time difference with CURTIME() or SUBTIME()
I have a db with some customers data. There I store their last login time as datetime.
I want to run a cron php script every min which will query mysqli for their last login datetime and if that was ...
1
vote
3answers
179 views
MySQL large databases, unique index effect on efficiency?
I'm working on a table which holds around 300k records. I'm using a 3 columns unique index to prevent duplicate records. For some reason the database is taking long to insert new rows.
I have a few ...
0
votes
1answer
70 views
MySQL collate error occurs when sent by PHP app but does not occur in phpMyAdmin
I have a query that uses:
t3.`value` LIKE "%someval%" COLLATE utf8_general_ci
I load the page in my browser and get this error printed to the screen:
COLLATION 'utf8_general_ci' is not valid for ...
2
votes
1answer
182 views
Parsing and binding variables for SELECT .. WHERE column IN ( .. ) queries
I'm looking to make sure that all queries in a php web application have proper use of bind variables to minimize parsing of the queries.
I'm wondering how Oracle parses queries that compares a ...
1
vote
1answer
61 views
Group activities in activity feed by users and products
On my website I'm building an activity feed where I got the basics done and are now making some improvements here and there.
One of them is the grouping. I've built it so that if multiple users buys ...
1
vote
2answers
208 views
mysql_select_db() very slow on a busy server
I have a MySQL Server with about 30 Databases and 1500 Tables. Overall size of the data is 2 GB. The Server has 16 GB RAM and an AMD FX-6100 CPU. Most tables are myisam.
On average the server answers ...
3
votes
1answer
107 views
What is the right way to manage users data?
I'm trying to create a simple register login script with user profiles, I created a table with the following structure:
+------------+---------------+------+-----+---------+----------------+
| Field ...
1
vote
0answers
110 views
big mysql database optimization
My Joomla mysql database has about 3.4 million rows in content table. It is just static article. Very slow and often use out of resources. To speed up it, I segmented it into 6 sub-tables and added ...
9
votes
1answer
165 views
Calculate MATCH() AGAINST() scores from UNIFIED QUERY not FOR EACH TABLE
I am trying to have a score for entire section of SELECT statements
SELECT *,MATCH(`result`) AGAINST('keyword') as `score` FROM `table1` WHERE MATCH(`result`) AGAINST('keyword')
UNION
SELECT ...
0
votes
1answer
642 views
Importing CSV file to MySQL via PHPMyAdmin
I am currently stuck and unable to upload a complete CSV file into a MySQL database. Unfortunately, the nice folks at Stackoverflow haven't been able to help me solve this issue, so I'm hoping someone ...
1
vote
2answers
79 views
Cannot INSERT into database on a shared server
I have launched an application on a shared server but I cannot INSERT any data. I thought maybe I don't have privileges so I did SHOW GRANTS in my application then die()
The result was [ EDITED ]:
...
2
votes
1answer
342 views
how to retrieve rows of different dates using IN clause
My table structure:
+-----------------+--------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
...
0
votes
1answer
217 views
Too many records on database and how to handle it? MySQL is it good to clone?
I am doing a social network and came up with the following concern regarding database storage. Let's put facebook as an example, imagine 2,000 photos per user, just 1,000 users, it would equal to ...
4
votes
2answers
76 views
Understanding COUNT() as `count`,
I'm currently learning how to build a site in PHP mysql. However, I seem to fail to understand COUNT() as count and wouldn't mind some further explanation.
I get the principles of COUNT, 0 || 1, and ...
-1
votes
2answers
98 views
How to update an SQL column using a known perm link while appending a value from another column within the same table? [closed]
Larger view of the issue is here: http://i1268.photobucket.com/albums/jj572/LinuxOwner/question.png
0
votes
1answer
193 views
Deleting Data From Multiple Tables
Suppose,I've a table called UNIVERSITY containing universities name:
universityID universityNAME isACTIVE
7 GNDU 1
6 PU 1
5 ...
1
vote
2answers
174 views
PHP-MYSQL messaging system performance problems
I want to create a messaging module for the social network web-site project (PHP & MySQL) I've been working on. What substructures do well-known sites use for modules like this?
I think, ...
1
vote
1answer
53 views
Sanitizing a form's database input while retaining basic HTML markup
Is there a way to sanitize database input (say, for a comment form), which also allows for the end user to use basic HTML styling markup? As in, if a user wraps their text in <i>/<em> or ...
5
votes
3answers
580 views
InnoDB Master-Master replication goes inconsistant after power failure tests
Afternoon gents,
I'm currently stress testing a Master-Master replication setup using InnoDB as database engine.
We're using this simple script for testing which we run in Linux CLI from a remote ...
1
vote
1answer
238 views
calculate the difference between two column aliases in a SELECT statement?
I'm not sure how to do the last part of my query, which is doing calculations directly with the aliases: (SUM(task_avg - minutes) AS difference. I don't think I can do it as easy as I'd like, but ...
0
votes
0answers
181 views
Trouble with PDO query + LEFT JOIN [closed]
I'm having trouble with a specific query (PDO style) that selects 4 fields from a table with a simple condition : contact_type='a' , label_id = a value (number) and also it checks that the particular ...
2
votes
1answer
553 views
shopping cart database schema
I need help creating the schema for a database to hold information relative to a web user's shopping cart/session. Each session will have a session ID, a time stamp holding time of creation, an expiry ...
0
votes
1answer
56 views
Searching through lots of applications
Google search has instant search feature. While you are typing, it finds the pages. Apple.com search box. StackExchange ask question part finds similar questions while you are typing question title.
...
0
votes
1answer
57 views
Is Index Used for This Query
If so, which one?
How do we know?
I have 3 indexes in a query. Actually only the first 2 should be useful
{
"v": NumberInt(1),
"key": {
"LongitudeLatitude": "2d",
"Prominent"â–¼: ...
0
votes
1answer
366 views
database creation using codeigniter database dbforge class gives “Access denied for user 'username'@'localhost' to database 'database_name' ”
Using codeigniter database dbforge class I have created a database and loaded that database as the current database and created tables in localhost WAMP server. But when I uploaded it to the server I ...
2
votes
1answer
534 views
Mongo connection failing with 'Transport endpoint is not connected'
I have a 2 server installation.
A web server with Apache and a DB server with MongoDB.
I am load testing it, and on ~300 RPS I am getting this error:
PHP Fatal error: Uncaught exception ...
3
votes
3answers
182 views
Database design for changing number of fields
Google Contacts lets you to enter more than one phone number, or email address for a contact. You can add as many as you want. I don't know if there is a limit, other than practical list size. To ...
0
votes
0answers
55 views
MySQL database design help
EDIT: also posted on stackoverflow: http://stackoverflow.com/questions/12148715/mysql-database-design-check-in-system
I am attempting to build a check-in system for an office building.
What happens ...
0
votes
1answer
398 views
WorkAround for PHP PDO(with libpq V 9.1.4) binding for use of CITEXT?
The scenario
Two systems(not server) running PHP and PostgreSQL with the following versions
Fedora 15:
PHP
PHP 5.3.13 (cli) (built: May 9 2012 14:38:35)
Copyright (c) 1997-2012 The ...
1
vote
1answer
166 views
MySQL table locks solution -> InnoDb / Partitions
I'm experiencing many table locks in a MyISAM MySQL table that is pretty big (Constx10xGB and 15M rows).
It's mainly caused due many heavy inserts. My current thoughts to optimize:
Changing to ...
2
votes
2answers
120 views
SQL SELECT Kill FROM problem
$sql = "SELECT Kill FROM tbl_pvporderview";
Problem is that il lend up with : Incorrect syntax near the keyword 'Kill'.
Cuz kill is a TSQL command... any way to bypass it?
I cant change the column ...
0
votes
0answers
299 views
Sqlsrv sqlsrv_num_rows FALSE, adding cursor type times out
$sql = "SELECT * FROM lastdeath";
$result = sqlsrv_query( $con, $sql);
if( $result === false )
{
die( print_r( sqlsrv_errors(), true));
}
$row_count = sqlsrv_num_rows($result);
echo $row_count;
...
3
votes
2answers
246 views
Which graph database for search engine and gis?
I just learned there are "graph databases" out there, which are more suited for two applications "search engine" and especially "gis".
To avoid discussions weather a relational DB is better suited ...
1
vote
0answers
181 views
MySQL GROUP BY and ORDER BY giving inconsistent results
I'm currently working with WordPress, and I've added a new meta value which is a number between 0 and 30. Zero is ignored and up to 30 need to be organised in order and only the latest (based on the ...
1
vote
1answer
398 views
“Mysql has gone away” heavy multiple insert
I am stuck because Mysql server will go away after executing this part of code this function will update the database with the new RSS feeds which are stored in ToUpdate but Mysql stops working. Every ...
4
votes
2answers
21k views
How to resolve too many connections and fatal error in mysql running on vps
I am running an application PHPlist on my linode server, simultaneously running 12 php scripts which open mysql connection, now when i access phplist it shows lot of times an error shows:
Fatal ...
1
vote
1answer
2k views
Connecting remote MySQL database to local MySQL database?
I want to write PHP code to be embedded in a Drupal7 module.
I want to call a procedure which can copy newly generated data in the local MySQL database to a remote MySQL database.
When data is ...
2
votes
1answer
657 views
How to speed up mysql query?
I have query :
SELECT
`school`.`ARCO_name`,
`student-`.`ClassSize_7`,
`student-`.`ClassSize_8`,
`degree_o`.`degree_code`,
`accredit`.`full_faculty_3`,
...
1
vote
0answers
541 views
SQL query optimization in Prestashop e-Commerce solution
I'm working on a layered navigation module within Prestashop e-Commerce solution.
I'm trying to optimize a SQL query which creates a temp table during execution. I think this is creating a ...
3
votes
3answers
4k views
How to use insert delay with the InnoDB engine and use less connection for insert statements?
I'm working on an application which involves a lot of database writes, approximately ~70% inserts and 30% reads. This ratio would also include updates which I consider to be one read and one write. ...
0
votes
2answers
3k views
Script to show mysql health status?
Kev suggested this question ( http://stackoverflow.com/questions/10524981/php-script-to-show-mysql-health-status ) is better fitted here.
I know phpMyAdmin can shows the lists of mysql vars and ...
4
votes
1answer
411 views
mysql change password in session
I changed my password from old hash to a new hash using the following query
SET SESSION old_passwords=FALSE;
SET PASSWORD = PASSWORD('[your password]');
I found this query on Mysql password hashing ...
3
votes
2answers
137 views
Selecting large data set on windows and linux
I need to parse a large data set, something like:
mysql_query("SELECT * FROM largeTable")
while($r = fetch()) {
//> Do something
}
I just need 1 row to be in memory at time, because I need to ...
1
vote
1answer
189 views
How to get a unique highscore per user
I have the following tables: users, highscores
I would like to get the top ten best results in highscore. The scores should be unique, meaning one score per user. I tried using INNER JOIN and GROUP ...
2
votes
3answers
592 views
Move Oracle data to and from MySQL with the help of PHP?
My application is in PHP which by default uses MySQL db. I have connected MySQL & Oracle dbs with PHP.
Now I want to move data from Oracle db into Mysql db through PHP. Is it possible to do? Is ...
