How do I automatically interrupting long queries in the mysql, if it possible?
I'm understand, that I need optimize queries instead of. But now I have access on database server only.
I want MySQL to autogenerate the id of a table so I have set AutoIncrement to TRUE but I get "Field 'id' doesn't have a default value". I even set a default value (=1 although I dont want a default value) but I get the same error.
Any idea why this is popping up :( ?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE `clocks` ( `id` int(11) NOT NULL AUTO_INCREMENT, ' at line 6
I am working on a game that I am going to open to the public to have on their game.
The game stores lots of information (about 300 rows) per website and spends a lot of time updating values within this MySQL database.
Is it better (faster/efficient) to add a new table for every website or to just have 1000's of rows in one table and add a column "website_id" or similar?
Is that possible that MySQL can handle grouping of data according to age bracket?
In my users table, age value is their actual age. I want to group them according to age bracket. For example:
ages below 1 year old as age1, 1-4 yrs as age2, 5-9 yrs. old as age3 and so on.
Hi all,
Did any know about how to search using latitude and longitude using latitude and longitude
using php and mysql as back-end.
I am having zip-code and latitude and longitude for the corresponding city.
With these things as back-end how can i do my search.
thanks in advance.
I'm using the date plugin for Template::Toolkit (Template::Plugin::Date), it works well with datetimes (yyyy-mm-dd hh:mm:ss) pulled straight out of MySQL, but it will not work with dates (yyyy-mm-dd).
What's the simplest way to get date.format to accept dates (without modifying the sql query)?
Thanks.
I have a database that won't grow much in size. It's current size is about 1 GB.
Achieving the fastest performance is desired.
Question: When should I use Memcache vs simply using MySQL Innodb ability to store all my content within RAM (innodb_buffer_pool_size)?
Hi,
I have 2 tables,
Table1: id,int1,int2,int3,int4,int5
Table2: integers (autoincrement),blobdata
The query I want to use is given the id I want to get the blobdata from table2 associated with the 5 integers in table1. I've only ever used one table in mysql so have no idea how to do this properly.
Is it possible?
EDIT: id is username, integers in table2 is just integers. but have not built the tables yet, so can change if need to.
I am playing around with PHPFog and as a result I ended up with a MySql database. I am trying to figure out how to connect to it with a success message.
PHPFog says use this:
mysql_connect(
$server = getenv('MYSQL_DB_HOST'),
$username = getenv('MYSQL_USERNAME'),
$password = getenv('MYSQL_PASSWORD'));
mysql_select_db(getenv('MYSQL_DB_NAME'));
So I basically plug my variables into the above? Or Do I do something different?
Thanks,
Jim
my Select query not worked when i worked with mysql and database have a huge amount of information.
i got error
System.NullReferenceException: Object reference not set to an instance of an object.
for
MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
I need to add a row to a MySQL database table but only if the row doesn't already exist. My database server just went down so I can't test this, but will this work as expected?
INSERT INTO `blocks` (`block_file`,`settings_group`)
VALUES ('announcements','announcement_settings')
WHERE NOT EXISTS (SELECT `block_file`,`settings_group`
FROM `blocks`
WHERE `block_file`='announcements' AND `settings_group`='announcement_settings')
It seems like sound logic. Is this a valid query or is there a better way of doing this?
Hello.
I got a script that create a new database, now I need to fill that database with tables and values (from a MySQL dump file).
I'm using PHP - Doctrine 1.2.
Here is how I create the database:
$manager = Doctrine_Manager::getInstance();
$newConn = $manager->openConnection($customer->Config->db_connection_string);
$newConn->createDatabase();
How I do this?
Thanks!
I need to insert same data to my MySQL table without having PHP loop. The reason why I'm doing this is that because I have a column with Auto_Increment feature and that column associates with other table.
So, I just need to insert some exactly same data and it's multiple rows (dynamic) but by using single INSERT syntax below :
INSERT INTO outbox_multipart (TextDecoded) VALUES ('$SMSMessage')
how to have this single INSERT syntax, but produce n number of rows?
Is there an easy way to order MySQL results respectively by WHERE id IN (...) clause?
Example:
SELECT * FROM articles WHERE articles.id IN (4, 2, 5, 9, 3)
to return
Article with id = 4
Article with id = 2
Article with id = 5
Article with id = 9
Article with id = 3
and also
SELECT * FROM articles WHERE articles.id IN (4, 2, 5, 9, 3) LIMIT 2,2
to return
Article with id = 5
Article with id = 9
I am designing a desktop application in C#, which needs to be connected to my online mysql database. I tried to give access in control panel a "%" which means from any IP, but it is not working. May be the hosting provider (bigrock) not allowing that.
Alternatively, I am trying to write some code in online on PHP which will get the "sql" as parameter and returns the output as JSON format using json_encode.
Is there any alternate methods which is better approach.
Hello
I am trying to copy a file into a fold called profile i got that working but i need the page to be .html i also need data from mysql to put in the html page how do i go about that can anyone help me please
Hi,
I am using mysql database for my asp.net website.I need to implement to single sign on for multiple instances of my website.Currently to check if a user has logged in I am using a user control which checks for a "loggedin" cookie with single instance of the website.Now I need to extend the logic to achieve single signon for multiple instances of the same site.
Could someone please help.
Thanks.
Gurus,
Wanted to find out the MySQL commercial license cost in India.
What does it cost to get a license for upto 10 users.
In US, I guess its 499$.
Please let me know as this is urgently required.
Thanks
Jad.
Hello,
tried connecting to mysql server in realbasic using the folowing code:
dim db as MySQLCommunityServer
db=New MySQLCommunityServer
db.host="192.168.240.129"
db.port=3306
db.databaseName="test"
db.userName="test"
db.Password="test"
If db.Connect() then
txt1.Text = "Connected"
else
txt1.Text = "Connection failed!"+ chr(13)+db.ErrorMessage
end if
and i get the following message
connection failed!
any suggestions..
Thanks