MySql Error will not let me connect to DB
(HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock Does anyone know of a solution to this problem? ...
(HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock Does anyone know of a solution to this problem? ...
Hi all, Sorry if this has been asked but can't find anything. I have a table that has two epoch timestamps (one is start of a session, other is end of a session), I want to find if a variable is in between column x and column y. I've used between to see if a column is between two variables but can't really think of the syntax for the ot...
I have color column in MySQL table which type is ENUM('RED', 'YELLOW', 'MY_COLOR', 'BLACK'), and another name column which type is VARCHAR(30). I would like to get all table rows in the following order: YELLOW rows first, sorted by name RED rows last, sorted by name In the middle, all other rows, sorted by name Is that possible to m...
Hi there, I've a case where I need to store twitter username, email, and some other field to be unique. However, I can only set twitter username later. Not on registration process. How can I handle this in SQL? Here's my current SQL structure: CREATE TABLE `kios_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(32) NO...
Hi all. So building on my question posted here http://stackoverflow.com/questions/3951716/using-python-to-write-to-html-file-with-mysql-data-as-source I have worked out how to do that although a bit different to the answers. Now my question is related to how to create html files from the data stored in MySQL, using the Category names fro...
My application let users to send files to each other. Regular users can edit their contacts, change password, etc. In addition, admin users can add/remove users and view the log of what happened. My question is how to store this log in MySQL database ? I thought to store the log like this: log_id time user_id action_type ...
I am using a simple PHP script for the activation part of one of my applications. The applications posts one variable to the page (http://validate.zbrowntechnology.info/WebLock.php?method=validate). The variable is the serial number, posted as 'Serial'. Each time I post to this page, it returns Invalid. Here is the code: <?php $serial...
I was wondering. I always do fetch and then create variables when I do loop. Is there a way to do this more efficient? Like as in automatically? Maybe something like convert_to_variable("name","description","etc") and it'll automatically set variables for me without having to do each manually? Or maybe a single command like convert_to_...
Hi, I've created a program in python and mySQL which creates a database and imports the data from text files and puts them into 4 different columns. The code works but I want to change the code and create functions. Can anyone please help me create a function that creates a mySQL database? Here is the code I have at the moment. Thanks ...
I have a facebook app that I have written in PHP/MYSQL and FBJS/AJAX. The app is Rails Across Europe, which may be found at http://apps.facebook.com/rails_across_europe (please note that it does require access to your FB data). If you would like to view a screencast of the app's operation, you may do so at http://screenr.com/TZR and http...
I have a table which contains two type of data, either for Company or Employee. Identifying that data by either 'C' or 'E' & a column storing primary key of it. So how can I give foreign key depending on data contained & maintain referential integrity dynamically. id | referenceid | documenttype ------------------------------- 1 | ...
So,we have a script which monitors mysql every 70 seconds. First it checks for the pidof mysql and then if it finds the pid, it runs mysqladmin -s status -p<password> Now recently we observed mysqld going to 100% cpu load. What I want to know is, will mysqladmin itself FAIL or stall or whatever when the cpu load is 100%? ...
Hello, I have a MySQL query called $sqlStr5 that ranks rows by a metric called totalScore2. One of the fields that $sqlStr5 returns is called username. I would like to echo out the rank and the value of totalScore2 where username equals a variable called $u. How can I do this? Below is what I have so far. Thanks in advance, John...
On our production server we need to split 900k images into different dirs and update 400k rows (MySQL with InnoDB engine). I wrote a python script which goes through next steps: Select small chunk of data from db (10 rows) Make new dirs Copy files to the created dirs and rename it Update db (there are some triggers on update which will...
Hello! I've got a huge mysql table (called tcountriesnew) and a column (called slogen, blob type). In each of those slogen blobs I'd like to replace a word, for example: banana to apple. Unfortunately I tried to print all the rows with word banana, and it did not work. select * from tcountriesnew where slogen like '%banana%'; Please ...
For example I have a list of words: men's package, moment, immensely How can I search in mysql sample text: "men's" and return only "men's package" I'm using this $str = str_replace("s", "%s", $str); If I search for "men's", it will only show: men's package but when I search for "mens" it will also show: men's package, moment, immense...
I have a MySQL table that looks like this: Table: Designer id: integer name: String gallery: string The gallery row can contain a string value like 23,36,45 Now I want to do a query similar to this: SELECT * FROM Designer WHERE gallery = '36' I know I kan use LIKE, but that is not precices enough. That could return bot...
I'm giving up for now with my JOIN creating a view for search reasons - I need help :/ Here are my tables: Profiles id company user_id 1 ACME 2 2 Joe 4 3 Wolf 5 Users id role_id online 2 4 2010-10-08 4 2 2010-10-08 5 4 2010-10-08 Rubrics id title 1 Stee...
If there is a null value stored in a MySQL INT column, it will return 0 when accessed by technoligies like JPA. If 0 value also stored in the column, how can I differentiate between null and 0? ...
Hi, I want to write a C-programm that gets some strings from input. I want to save them in a MySQL database. For security I would like to check, if the input is a (possible) UTF-8 string, count the number of characters and also use some regular expressions to validate the input. So my question is the following: Is there a library that ...