w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
mysql general log cant find file
Mine are set in a custom location with the permissions -rw-rw-rw- and owner and group are set to root. You should also make sure that whatever user you're giving the permissions to has access to every directory above the one you're trying to give it access to. Also, I'd recommend that you don't put your logs inside of public_html. This will allow malicious persons to gain information about your SQL version and such, and even worse, give them a place to see if what they're trying is working.

Categories : Mysql

Unable to login to MYSQL getting error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
It seems like a permission issue, try disabling selinuza by using setenforce 0, then restart the mysql service, also check if mysql has the right permissions on the mounted device (assuming you mounted as root or a sudo user that mysql cannot access)

Categories : Mysql

Importing 2.25 million entries into MYSQL... PHP foreach loop, or MYSQL file import? How should I do it?
I suggest using INSERT_IGNORE in your query: INSERT IGNORE INTO exampletable ( column1, column2 ) VALUES( value1, value2 ); This way it will ignore the row on duplicate keys. http://dev.mysql.com/doc/refman/5.6/en/insert.html

Categories : PHP

XAMPP/MySQL: could not open single-table tablespace file .mysqlinnodb_index_stats.ibd after restart of MySQL
Move (DON'T DELETE) those files, into another folder: innodb_index_stats.frm innodb_table_stats.frm slave_master_info.frm slave_relay_log_info.frm slave_worker_info.frm and .ibd files with the same filename: innodb_index_stats.ibd innodb_table_stats.ibd slave_master_info.ibd slave_relay_log_info.ibd slave_worker_info.ibd Try start MySQL.

Categories : PHP

RDS MySQL Data to a Flat File to Reload in another MySQL - Std CLI Not Working
I would strongly suggest Option C, which is to use an ETL tool to move the data. I have used the Community edition of Pentaho Data Integration very successfully to do the sort of things you're asking about (especially the cleanup). It's more work than a simple dump and load, but you have very good control and can do things like sync up again later and so on.

Categories : Mysql

Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) Fedora Linux
What i can think right now if you've already tried the solutions in your link, is that SELinux (Fedora's) is blocking service. try sudo setenforce 0 and then sudo service mysqld start let me know if it helped please

Categories : Mysql

DBD-mysql installed ,but still error "install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC"
Perhaps the DBD::mysql perl module hasn't been fully installed ...so install it. cpan DBD::mysql Or since you don't have internet access, perl Makefile.PL make make test make install You'll need MySQL's development header files installed first, as per INSTALL

Categories : Perl

Find pattern in some mysql row with php
Here's how you can do it in SQL. select count(*) match_count from TheTable t1 join TheTable t2 on t1.id+1 = t2.id join TheTable t3 on t1.id+2 = t3.id where t1.value = 1 and t2.value = 0 and t3.value = 1

Categories : PHP

MYSQL find max value from each department
Use GROUP BY with the aggregate function MAX(): SELECT MAX(salary), departmentid FROM your_table GROUP BY departmentid;

Categories : Mysql

Find out how often a value is between 2 dates in mysql
Try: $query = "SELECT id, user, COUNT(*) as count FROM stat WHERE timestamp BETWEEN '$datum1' AND '$datum2' GROUP BY timestamp"; This will return the number of entries in the value 'count' if you want distinct data, in place of * use COUNT(DISTINCT id) with whatever field you want to be unique in place of 'id'

Categories : PHP

Mysql Error I can't find/may not exist
To be honest.. it is very hard to debug like this. There could be a chance that in REMARKS field, you have un-escaped double quote or other characters that break the query compiling. Have you tried to insert a small amount of data first? I will suggest inserting a 'hello world' first before going crazy with this kind of insert. I also suggest using single quote like '$listing[REMARKS]' as the default mysql syntax.

Categories : Mysql

Cannot find module `mysql` node.js
It looks like you might be confused about how npm install works. npm install -g mysql will install globally not locally like you suggest. npm install mysql will install locally, putting the module in ./node_modules/mysql. This means the script you are running needs to be run from the same directory containing node_modules.

Categories : Mysql

MySQL C# Find Lat Lon entries within a certain max distance
This means that linq doesn't know how to translate your function into SQL. What you have to do is pull out your data first and then run your logic on that: IQueryable<myTable> busLst = (from b in db.myTable.AsEnumerable() where (3959 * Math.Acos(Math.Cos(radians(latLonRequest.lat)) * Math.Cos(radians(b.lat)) * Math.Cos(radians(b.lon) - radians(latLonRequest.lon)) + Math.Sin(radians(latLonRequest.lat)) * Math.Sin(radians(b.lat)))) < latLonRequest.MaxDistance select b ); This will enumerate the results before running your math functions. Your better bet is bu

Categories : C#

mysql, find frequenties in table
I think this is the most efficient method: select name, sum(n = 1) as Column1Cnt, sum(n = 2) as Column1Cnt, sum(n = 3) as Column1Cnt from (select (case when n.n = 1 then column1 when n.n = 2 then column2 when n.n = 3 then column3 end) as name, n.n from t cross join (select 1 as n union all select 2 union all select 3) n ) t This should be more efficient that a union all query because it only scans the original table once. I've shown the example here for three columns (as in your sample data). It should be clear how to generalize this to six columns.

Categories : Mysql

How to find Total of sum of rows in mysql?
Simply running a nested query should work: SELECT SUM(s) as Score FROM (SELECT SUM( Mark_score ) / SUM( Full_mark ) *50 AS s FROM nuexam WHERE regd = '22' GROUP BY subject) table

Categories : PHP

Couldn't find MySQL as service
Some of this is supposition, as I am a WAMP user by preference but I have used XAMPP in the past: I think that the Install on E: caused the Apache and MySQL services to be installed from the E:xampp directories, negating the G: installed versions. When you uninstalled the E: version it should have removed both Apache and MySQL services. If you still have the version on G: I seem to remember there is a way of re-installing the Apache and MySQL services so run the XAMMP icon and I think there is a button for each service, somethng like SVC beside the info about Apache and MySQL that tells you its running or not, and that will reinstall the services from whereever you ran the XAMPP controller from. As to the databases you created using the E: version you installed, If the uninstall is wri

Categories : Mysql

Mysql query find substring
If that is the case, then you can do: select * from country where concat(' ', SEARCHSTRING, ' ') like concat('% ', name, ' %') Or you can use find_in_set(): select * from country where find_in_set(name, replace(SEARCHSTRING, ' ', ',')) > 0;

Categories : Mysql

MySQL find if other row(s) exist in the same table with the same value
SELECT t1.attendance FROM events t1 WHERE promoter_id = 5 AND EXISTS (SELECT event_id FROM events WHERE promoter_id!=5 AND venue_id = t1.venue_id=venue_id AND event_date = t1.event_date)

Categories : Mysql

Mysql find mode of columns
You could try: select modeval, count(*) mode from (select col1 modeval FROM alterations union all select col2 modeval FROM alterations union all select col3 modeval FROM alterations union all select col4 modeval FROM alterations union all select col5 modeval FROM alterations union all select col6 modeval FROM alterations union all select col7 modeval FROM alterations union all select col8 modeval FROM alterations union all select col9 modeval FROM alterations union all select col10 modeval FROM alterations union all select col11 modeval FROM alterations union all select col12 modeval FROM alterations) sq GROUP BY modeval ORDER BY mode DESC LIMIT 1

Categories : PHP

MYSQL Query to find matches LIKE
Then Remove the filter from your where clause :: SELECT * FROM filter LIMIT 0 , 30 If you need record having filter starting with 'The.White.Tiger' Try : SELECT id FROM filter WHERE filter LIKE 'The.White.Tiger%' LIMIT 0 , 30

Categories : Mysql

MySQL find duplicates + one other field
Here's one way to get the specified result: SELECT s.username , s.acctsessionid FROM ( SELECT r.username FROM radacct r WHERE r.acctstoptime IS NULL GROUP BY r.username HAVING COUNT(1) > 1 ) d JOIN radacct s ON s.username = d.username WHERE s.acctstoptime IS NULL ORDER BY s.username , s.acctsessionid

Categories : Mysql

MySQL - Find pairs in either column
For Simpson, you want to include rows where either name is "Simpson", but the name you want to select (and count for) is the "non-Simpson" name. You can do it like this: SELECT CASE WHEN Name1 <> 'Simpson' THEN Name1 ELSE Name2 END AS ClickName, SUM(count) AS ClickCount FROM fullNames WHERE 'Simpson' IN (Name1, Name2) GROUP BY CASE WHEN Name1 <> 'Simpson' THEN Name1 ELSE Name2 END ORDER BY ClickCount DESC

Categories : PHP

php&mysql find parent category name
You have to use LEFT JOIN to be able to pull all categories no matter have they parent category or not. INNER JOIN filters out all mismatches. SELECT c.id, c.title, c.parent, p.title parent_title FROM categories c LEFT JOIN categories p ON c.parent = p.id Output: | ID | TITLE | PARENT | PARENT_TITLE | ------------------------------------------------- | 1 | First Category | 0 | (null) | | 2 | Other Category | 1 | First Category | Here is SQLFiddle demo

Categories : PHP

Find most recent duplicates ID with MySQL
delete from wineries where id not in ( select * from ( select min(id) from wineries group by email ) x ) You need a subquery to trick MySQL to delete from a table it is selecting from at the same time.

Categories : Mysql

MySql Php Find Similar Values
You can use levenshtein(str1, str2) that will return an integer witch is the distance between the two strings. In PHP if one string is longer that 255 characters the function will return -1. More info: http://php.net/manual/en/function.levenshtein.php or if you want in percent you can use similar_text ( string $first , string $second, [, float &$percent ] ) witch pass in the 3rd parameter the percent of similarity More info: http://www.php.net/manual/en/function.similar-text.php

Categories : PHP

MySQL: find all users with a given permission for a db
select * from mysql.user where `Execute_priv` = 'Y' Replace Execute_priv with the column name of the other priviledges you're after For priviledges on a DB by DB basis, try querying the mysql.db table: select * from mysql.db where `Db` = 'databasename' and `Execute_priv` = 'Y'

Categories : Mysql

How to find that a value in column has related value in another row in mysql
First, Bluefeet is right. You should store your data in a normalized format. That is, you should have a table called something like MenuConflicts, with one column for Menu_Name and another for one Conflict. That said, you can do what you want with an arcane join using find_in_set(): select * from t t1 join t t2 on find_in_set(t2.menu_name, t1.conflicts) > 0 where find_in_set(t1.menu_name, t2.conflicts) = 0; The join matches any row where the second menu name is in the first conflict list. The where clause then checks the additional reciprocal condition.

Categories : Mysql

Find top 10% students in a class using mysql
Try following query and formula for finding top 10% students: SELECT Floor(100 * 0.1) INTO @my_limit; PREPARE STMT FROM 'SELECT * FROM alphatable LIMIT ?'; EXECUTE STMT USING @my_limit; NOTE: Please add other required filters in query and also recheck your formula.

Categories : Mysql

mysql - query to find SUM accrued per hour per day
Brief idea. Come up with a range of hours on the relevant day (assuming the day is a known in advance for the query) and do a JOIN where this is between the start and end time. Like this:- SELECT DATE_ADD('2013/06/17', INTERVAL thehour HOUR), COUNT(teamslot_schedule.id) FROM shifthours LEFT OUTER JOIN teamslots ON DATE_ADD('2013/06/17', INTERVAL thehour HOUR) BETWEEN starttime AND starttime AND endtime LEFT OUTER JOIN teamslot_schedule ON teamslots.id = teamslot_schedule.slotid GROUP BY DATE_ADD('2013/06/17', INTERVAL thehour HOUR) Note that this is not going to work straight out as I am not sure how your starttime / endtime relate to the startdate.

Categories : Mysql

mysql error 1064, i can't find the mistake
You have to provide the amount of decimal places for double, e. g. double (7, 2 ) means your number has a total of 7 digits, whereof 2 are decimal places, just like 10233,95 btw I would strongly recommend to get attuned to use english column names.. there will be one day people who need to understand your DB scheme and do not speak your language

Categories : Mysql

How would I modify this MySQL Query to find a rank?
SELECT s.squad_id AS squad_id, s.ladder_id, s.team_id AS team_id, x.experience_id, x.squad_id, SUM(x.value) as total_exp, @i:=@i+1 AS rank FROM league_squads AS s LEFT JOIN league_experience AS x ON (s.squad_id = x.squad_id), (SELECT @i:=0) AS foo WHERE s.ladder_id = 1 GROUP BY s.squad_id, s.ladder_id, s.team_id, x.experience_id, x.squad_id ORDER BY total_exp DESC sample fiddle

Categories : PHP

MySQL: find relative values in a query
Assuming you have a panel_id on the panel_participants table the following should get you a list of people who have 2 panels to participate in for the same time slot:- SELECT DISTINCT pp.user_id FROM panel_participants pp INNER JOIN panel_participants pps ON pp.user_id = pps.user_id AND pp.day_time_slot_id = pps.day_time_slot_id AND pp.panel_id != pps.panel_id AND pp.day_time_slot_id > 0 The following should find those with appointments for 2 consecutive slots (although not sure why consecutive slots should be 2 apart). SELECT DISTINCT pp.user_id FROM panel_participants pp INNER JOIN panel_participants pps ON pp.user_id = pps.user_id AND pp.day_time_slot_id + 2 = pps.day_time_slot_id AND pp.day_time_slot_id > 0 Afraid I can't test this (or be certain) as you have posted

Categories : Mysql

Find equal columns in different tables in mysql
I don't know how your table looks, so I would just write how I would do it (P.S there can be better ways) 1) select all the values from the first table. 2)make two loops, first to search from second table, and second to search from third table. 3) count number of rows. 4) if number of rows is more than one, you know you have duplicate.

Categories : PHP

Mysql: Find rows, where timestamp difference is less than x
DATEDIFF(t.netxdata, t.date) < (1300 / 3600 / 24) I assumed 1300 in in seconds, so I converted it to days which is what DATEDIFF returns. Please, be aware that this query will do a full scan of your table, which might be expensive.

Categories : Mysql

Find non-ascii spaces in mysql table
Your regex will match rows that have one or more characters in the set {A-Z, a-z, 0-9, space, semicolon, colon}. Better to look specifically for non-printable characters using the POSIX [:cntrl:] character class: SELECT * FROM TABLE WHERE FIELD REGEXP '[[:cntrl:]]'

Categories : Mysql

How can you find a variable length substring in MySQL?
Given any string you have, you can still use right in conjunction with lenght: select * from substr_table where right('foobar', length(substrings)) = substrings However, this sounds like a terrible application design.

Categories : Mysql

Find and replace

with return key entry in MySQL

Given your example, the <p> elements are not necessary. They can just be replaced with : UPDATE yourTable SET theColumn = REPLACE(theColumn, '<p>', ' ')

Categories : Mysql

find dates of data gaps from mysql db with php
There are several ways to find the gaps using a sql query, check this post: Method of finding gaps in time series data in MySQL?

Categories : PHP

Find and transfrer mysql database to another computer
MYSQL DUMP It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server).

Categories : Mysql

Find a word in stored views of MySQL
You can utilize information schema for this. Try something like this: SELECT TABLE_NAME FROM information_schema.views WHERE VIEW_DEFINITION LIKE '%your_word%'; Above query is not tested, but it will give you the name of the view which contains the word you are searching for. You can also refer to the docs on information_schema.views and craft a query which is more suitable for your needs: The INFORMATION_SCHEMA VIEWS Table

Categories : Mysql



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.