mysql5

apache tomcat 7.0.30 datasourcerealm javax.naming.NameNotFoundException: Name [jdbc/proto] is not bound in this Context. Unable to find [jdbc]

做~自己de王妃 提交于 2019-12-01 01:54:45
问题 let me describe the environment first: environment: - mac os x (java build 1.6.0_35-b10-428-11M3811) - apache tomcat 7.0.30 - mysql 5.5.27 - tomcat/lib --> mysql-connector-java-5.1.22-bin.jar i've implemented successfully a JDBCRealm and want to switch to a DataSourceRealm because it is recommended for production environments. i use form-based authentication. I did everything described here: http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#DataSourceRealm and here: http://tomcat

counting data and grouping by week in mysql

非 Y 不嫁゛ 提交于 2019-11-29 12:32:05
this is my DB table: CREATE TABLE IF NOT EXISTS `inspection_report` ( `Inspection_datetime` datetime NOT NULL, `Line` char(5) NOT NULL, `S` int(11) NOT NULL, `A` int(11) NOT NULL, `B` int(11) NOT NULL, `C` int(11) NOT NULL, INSERT INTO `inspection_report` (`Inspection_datetime`,`Line`,`S`, `A`, `B`, `C`) VALUES ('2010-09-01 09:08:01','FA 05',0, 0, 0, 0),('2010-09-02 14:24:35','FA 07',0, 0, 1, 0),('2010-09-01 09:08:01','fa 05',0, 1, 1, 0),('2010-09-01 16:24:04','FA 03', 0, 1, 0, 0); I have a lot of data for this table.how do i do if i want show the result like: Line 1st week 2nd week 3rd week

MySQL group by date and count including missing dates

血红的双手。 提交于 2019-11-29 07:48:41
Previously I was doing following to get per day count from reports table. SELECT COUNT(*) AS count_all, tracked_on FROM `reports` WHERE (domain_id = 939 AND tracked_on >= '2014-01-01' AND tracked_on <= '2014-12-31') GROUP BY tracked_on ORDER BY tracked_on ASC; Obviously this wont give me 0 count for missing dates. Then I finally found a optimum solution to generate date-series between given date range. But the next challenge am facing is to join it with my reports table and get the count grouped by date. select count(*), all_dates.Date as the_date, domain_id from ( select curdate() - INTERVAL

How to Run PHP on IIS7.5 Express?

人盡茶涼 提交于 2019-11-29 03:21:05
I have Win XP SP3 and have installed IIS7.5 Express and want to run PHP on it. I am able to run simple HTML code on the server, I am able to start and stop the server by running iisservices.exe, but I am not able to run php scripts on it. If I have the following PHP file: <? php echo "hello world"; ?> <html>HI</html> The output is HI but the PHP script doesn't run. I have followed the steps described in this article to install PHP: http://learn.iis.net/page.aspx/724/install-and-configure-php/ But can't proceed from step 10 onwards because IIS Express doesn't have an IIS Management Console MMC

How to get a list of user accounts using the command line in MySQL?

北战南征 提交于 2019-11-28 14:54:06
I'm using the MySQL command line utility and can navigate through a database. Now I need to see a list of user accounts. How can I do this? I'm using MySQL version 5.4.1 . Use this query: SELECT User FROM mysql.user; Which will output a table like this: +-------+ | User | +-------+ | root | +-------+ | user2 | +-------+ As Matthew Scharley points out in the comments on this answer , you can group by the User column if you'd only like to see unique usernames. I find this format the most useful as it includes the host field which is important in MySQL to distinguish between user records. select

How to get a list of user accounts using the command line in MySQL?

末鹿安然 提交于 2019-11-28 13:06:56
问题 I'm using the MySQL command line utility and can navigate through a database. Now I need to see a list of user accounts. How can I do this? I'm using MySQL version 5.4.1 . 回答1: Use this query: SELECT User FROM mysql.user; Which will output a table like this: +-------+ | User | +-------+ | root | +-------+ | user2 | +-------+ As Matthew Scharley points out in the comments on this answer, you can group by the User column if you'd only like to see unique usernames. 回答2: I find this format the

counting data and grouping by week in mysql

妖精的绣舞 提交于 2019-11-28 06:47:40
问题 this is my DB table: CREATE TABLE IF NOT EXISTS `inspection_report` ( `Inspection_datetime` datetime NOT NULL, `Line` char(5) NOT NULL, `S` int(11) NOT NULL, `A` int(11) NOT NULL, `B` int(11) NOT NULL, `C` int(11) NOT NULL, INSERT INTO `inspection_report` (`Inspection_datetime`,`Line`,`S`, `A`, `B`, `C`) VALUES ('2010-09-01 09:08:01','FA 05',0, 0, 0, 0),('2010-09-02 14:24:35','FA 07',0, 0, 1, 0),('2010-09-01 09:08:01','fa 05',0, 1, 1, 0),('2010-09-01 16:24:04','FA 03', 0, 1, 0, 0); I have a

“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax error” Hibernate 4 [duplicate]

空扰寡人 提交于 2019-11-28 04:50:51
问题 This question already has answers here : How can I write SQL for a table that shares the same name as a protected keyword in MySql? [duplicate] (3 answers) Closed 6 years ago . I'm getting the error I added below while saving Folder entities into database using Hibernate 4.1 & MySQL 5 . I don't have any problems with other entitites. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax Here's my Folder table: CREATE TABLE

MySQL Levenshtein

半腔热情 提交于 2019-11-27 21:44:19
I'm trying to create a MySQL function for calculating the levenshtein distance. I found a function which looked pretty close to what I need, however it keeps throwing errors everywhere - I am new to MySQL functions so I have no idea what is wrong? Here is the function: DELIMITER $$ CREATE FUNCTION LEVENSHTEIN( s1 CHAR(255), s2 CHAR(255)) RETURNS int(3) DETERMINISTIC BEGIN DECLARE s1_len, s2_len, i, j, c, c_temp, cost INT; DECLARE s1_char CHAR(255); DECLARE cv0, cv1 CHAR(255); SET s1_len = LENGTH(s1); SET s2_len = LENGTH(s2); SET cv1 = 0x00; SET j = 1; SET i = 1; SET c = 0; IF s1 = s2 THEN

How to Run PHP on IIS7.5 Express?

爱⌒轻易说出口 提交于 2019-11-27 17:30:43
问题 I have Win XP SP3 and have installed IIS7.5 Express and want to run PHP on it. I am able to run simple HTML code on the server, I am able to start and stop the server by running iisservices.exe, but I am not able to run php scripts on it. If I have the following PHP file: <? php echo "hello world"; ?> <html>HI</html> The output is HI but the PHP script doesn't run. I have followed the steps described in this article to install PHP: http://learn.iis.net/page.aspx/724/install-and-configure-php/